// Jolly Jumper
// uva 10038
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#define MAXSIZE 3001
int main()
{
// record whether the number from 1 to MAXSIZE-1 appeared.
// the effective index is in [1,(MAXSIZE-1)],
// so the array size will be MAXSIZE
bool appeared[MAXSIZE];
int n; // how many numbers
int numbers[MAXSIZE];
// counter
int i;
bool isJolly;
int difference;
while (scanf("%d", &n) != EOF){
isJolly = true;
// read numbers
for (i = 0; i < n; i++){
scanf(" %d", &numbers[i]);
}
memset((appeared + 1), false, n);
// record number that appeared
for (i = 1; i < n; i++){
difference = abs(numbers[i]-numbers[i-1]);
if (difference >= 1 && difference <= n-1)
appeared[difference] = true;
}
// check Jolly
for (i = 1; i <= n-1; i++){
if (appeared[i] == false){
isJolly = false;
break;
}
}
printf("%s", (isJolly ? "Jolly\n": "Not jolly\n"));
}
return 0;
}