///
#include <iostream>
#include <algorithm>
using namespace std;
bool st[3000];
int main()
{
int n;
int a,b;
while(cin>>n)
{
cin>>a;
int i;
int temp;
for(i=0;i<3000;i++)
st[i]=0;
for(i=1;i<n;i++)
{
cin>>b;
temp=abs(a-b);
if(temp<1 || temp>n-1)
continue;
st[temp]=1;
a=b;
}
int flag=1;
for(i=1;i<=n-1;i++)
if(!st[i])
flag=0;
if(flag)
cout<<"Jolly"<<endl;
else
cout<<"Not jolly"<<endl;
}
return 0;
}