#include<bits/stdc++.h>
using namespace std;
int i=1;
int a[1001];
int b[1001];
bool f=1;
int main(){
while(getchar()!='\n'){
cin>>a[i];
i++;
}
for(int s=1;s<i;s++){
b[s]=abs(a[s+1]-a[s]);
}
sort(b,b+i-1);
b[i]=i;
for(int s=1;s<i;s++){
if(b[s+1]-b[s]!=1){
f=0;
}
}
if(f){
cout<<"Jolly";
}else{
cout<<"Not jolly";
}
return 0;
}