#include <stdio.h>
int main ()
{
int x [ 3050] , n , a [3050] , i ,p ,m ,cnt,cnt2 ;
while ( scanf ("%d",&n) ==1 && n > 0 )
{
for (i= 1 ; i <= n ;i++)
{
scanf ("%d",&a [i]) ;
}
for (i =1 ; i <= n-1 ; i++)
{
if (a [i] > a [i+1])
{
x [ i] = a[i] - a[i+1] ;
}
else
{
x [i] =a[i+1] - a[i] ;
}
}
cnt=0 ; cnt2 =0 ;
for (p =1 ;p <= n-1 ;p++)
{
cnt2 ++ ;
for (m=1 ; m <= n-1 ; m++)
{
if (p == x [m] )
{
cnt ++ ;
break ;
}
}
}
if (cnt == cnt2 ) printf ("Jolly\n") ;
else printf ("Not jolly\n") ;
}
return 0 ;
}
int main ()
{
int x [ 3050] , n , a [3050] , i ,p ,m ,cnt,cnt2 ;
while ( scanf ("%d",&n) ==1 && n > 0 )
{
for (i= 1 ; i <= n ;i++)
{
scanf ("%d",&a [i]) ;
}
for (i =1 ; i <= n-1 ; i++)
{
if (a [i] > a [i+1])
{
x [ i] = a[i] - a[i+1] ;
}
else
{
x [i] =a[i+1] - a[i] ;
}
}
cnt=0 ; cnt2 =0 ;
for (p =1 ;p <= n-1 ;p++)
{
cnt2 ++ ;
for (m=1 ; m <= n-1 ; m++)
{
if (p == x [m] )
{
cnt ++ ;
break ;
}
}
}
if (cnt == cnt2 ) printf ("Jolly\n") ;
else printf ("Not jolly\n") ;
}
return 0 ;
}