#include using namespace std; const int N = 1010; int a[N]; unordered_set s; int main() { int n; cin >> n; for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 1; i < n; i++) { int x = abs(a[i] - a[i - 1]); s.insert(x); } for (int i = 1; i <= n - 1; i++) { //如果发现缺失,就不是欢乐的跳 if (s.count(i) == 0) { cout << "Not jolly" << endl; exit(0); } //如果成功到达最后,就是欢乐的跳 if (i == n - 1) cout << "Jolly" << endl; } return 0; }