시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 988 220 155 25.081%

문제

Jolly jumper라 불리는 수열이 있다. 길이가 1인 수열은 무조건 Jolly jumper이고, 길이가 2이상일 때는 n개의 연속된 두 수의 차의 절댓값이 1부터 n-1까지 모두 나와야 Jolly jumper라고 한다. 예를 들어

1 4 2 3

이것은 Jolly jumper인데, 두 수의 차의 절댓값이 각각 3,2,1이기 때문이다. 하여튼 조건을 충족하면 어느 수열이든 Jolly jumper라 할 수 있다. 이제 각 케이스마다 Jolly jumper인지를 판별하자.

입력

각 줄의 첫 수로 n이 주어진다.(n < 3000) 그 다음에는 n개의 수가 주어진다.

출력

각 줄마다 Jolly 인지 Not jolly 인지 출력한다.

예제 입력 1

4 1 4 2 3
5 1 4 2 -1 6

예제 출력 1

Jolly
Not jolly
W3sicHJvYmxlbV9pZCI6IjQzODMiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWM4MTBcdWQ1MDRcdWIyOTQgXHVjOTkwXHVhYzcwXHVjNmNjIiwiZGVzY3JpcHRpb24iOiI8cD5Kb2xseSBqdW1wZXJcdWI3N2MgXHViZDg4XHViOWFjXHViMjk0IFx1YzIxOFx1YzVmNFx1Yzc3NCBcdWM3ODhcdWIyZTQuIFx1YWUzOFx1Yzc3NFx1YWMwMCAxXHVjNzc4IFx1YzIxOFx1YzVmNFx1Yzc0MCBcdWJiMzRcdWM4NzBcdWFjNzQgSm9sbHkganVtcGVyXHVjNzc0XHVhY2UwLCBcdWFlMzhcdWM3NzRcdWFjMDAgMlx1Yzc3NFx1YzBjMVx1Yzc3YyBcdWI1NGNcdWIyOTQgblx1YWMxY1x1Yzc1OCBcdWM1ZjBcdWMxOGRcdWI0MWMgXHViNDUwIFx1YzIxOFx1Yzc1OCBcdWNjMjhcdWM3NTggXHVjODA4XHViMzEzXHVhYzEyXHVjNzc0IDFcdWJkODBcdWQxMzAgbi0xXHVhZTRjXHVjOWMwIFx1YmFhOFx1YjQ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