/* coder: ACboy date: 2010-2-22 result: AC description: */ #include <iostream> using namespace std; #define MAXN 3000 + 10 int flag[MAXN]; int data[MAXN]; int main() { int i, j; int n; #ifndef ONLINE_JUDGE freopen("10038.txt", "r", stdin); #endif while (cin >> n) { for (i = 0; i < n; i++) { cin >> data[i]; } memset(flag, 0, sizeof(flag)); int ans = 1; for (i = 0; i < n - 1; i++) { if (abs(data[i + 1] - data[i]) > n - 1) { ans = 0; break;} if (flag[abs(data[i + 1] - data[i])] == 0) flag[abs(data[i + 1] - data[i])] = 1; else { ans = 0; break; } } if (ans) cout << "Jolly" << endl; else cout << "Not jolly" << endl; } return 0; }