#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
size_t abs(int);
int /*<<< orphan*/ printf(char *);
scalar_t__ scanf(char *, int *);
int main(void) {
  int n, i, a, b;
  while (scanf("%d ", &n) > 0) {
    int jolly[3000] = {0};
    if (n > 0)
      scanf("%d ", &a);
    for (i = 1; i < n; i++) {
      scanf("%d ", &b);
      jolly[abs(a - b)] = 1;
      a = b;
    }
    for (i = 1; i < n && jolly[i]; i++)
      ;
    if (i == n && 0 != n)
      printf("Jolly\n");
    else
      printf("Not jolly\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2f10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xea7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
cmp    $0x0,%rax
jle    1275 <main+0x135>
lea    -0x2f00(%rbp),%rdi
xor    %esi,%esi
mov    $0x2ee0,%edx
call   1050 <memset@plt>
cmpl   $0x0,-0x8(%rbp)
jle    1199 <main+0x59>
lea    0xe70(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1060 <scanf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11e6 <main+0xa6>
lea    0xe4d(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x10(%rbp),%edi
sub    -0x14(%rbp),%edi
call   1030 <abs@plt>
movl   $0x1,-0x2f00(%rbp,%rax,4)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11a0 <main+0x60>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0x2f01(%rbp)
jge    1216 <main+0xd6>
movslq -0xc(%rbp),%rax
cmpl   $0x0,-0x2f00(%rbp,%rax,4)
setne  %al
mov    %al,-0x2f01(%rbp)
mov    -0x2f01(%rbp),%al
test   $0x1,%al
jne    1229 <main+0xe9>
jmp    123c <main+0xfc>
jmp    122e <main+0xee>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11ed <main+0xad>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1264 <main+0x124>
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
je     1264 <main+0x124>
lea    0xdaa(%rip),%rdi
call   1040 <printf@plt>
jmp    1270 <main+0x130>
lea    0xda0(%rip),%rdi
call   1040 <printf@plt>
jmp    1152 <main+0x12>
xor    %eax,%eax
add    $0x2f10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2ef8,%rsp
lea    0xea8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
test   %rax,%rax
jle    127d <main+0x13d>
lea    0x10(%rsp),%r13
lea    0xe89(%rip),%rbx
lea    0xc(%rsp),%r15
lea    0x8(%rsp),%r12
lea    0xe86(%rip),%rbp
jmp    11d2 <main+0x92>
lea    0xe7d(%rip),%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    %eax,%r14d
lea    0xe5a(%rip),%rcx
mov    %rcx,%rdi
cmove  %rbp,%rdi
test   %eax,%eax
cmove  %rcx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
test   %rax,%rax
jle    127d <main+0x13d>
mov    $0x2ee0,%edx
mov    %r13,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
mov    0x4(%rsp),%eax
mov    $0x1,%r14d
test   %eax,%eax
jle    11a0 <main+0x60>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x2,%eax
jl     11a0 <main+0x60>
mov    $0x1,%ebp
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <scanf@plt>
mov    0xc(%rsp),%edi
sub    0x8(%rsp),%edi
call   1040 <abs@plt>
movl   $0x1,0x10(%rsp,%rax,4)
mov    0x8(%rsp),%eax
mov    %eax,0xc(%rsp)
add    $0x1,%ebp
mov    0x4(%rsp),%eax
cmp    %eax,%ebp
jl     1210 <main+0xd0>
mov    $0x1,%r14d
cmp    $0x2,%eax
jl     118a <main+0x4a>
mov    $0x1,%r14d
lea    0xdaf(%rip),%rbp
nop
cmpl   $0x0,0x10(%rsp,%r14,4)
je     11a0 <main+0x60>
add    $0x1,%r14
cmp    %r14,%rax
jne    1260 <main+0x120>
mov    %eax,%r14d
jmp    11a0 <main+0x60>
xor    %eax,%eax
add    $0x2ef8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [7 x i8] c"Jolly\0A\00"
@.str.2 = [11 x i8] c"Not jolly\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [3000 x i32]
store i32 0, i32* %1
br label %7
7: ; preds = %60, %0
%8 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2)
%9 = icmp sgt i64 %8, 0
br i1 %9, label %10, label %61
10: ; preds = %7
%11 = bitcast [3000 x i32]* %6 to i8*
%12 = load i32, i32* %2
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %4)
br label %16
16: ; preds = %14, %10
store i32 1, i32* %3
br label %17
17: ; preds = %29, %16
%18 = load i32, i32* %3
%19 = load i32, i32* %2
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %32
21: ; preds = %17
%22 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %5)
%23 = load i32, i32* %4
%24 = load i32, i32* %5
%25 = sub nsw i32 %23, %24
%26 = call i64 @abs(i32 %25)
%27 = getelementptr inbounds [3000 x i32], [3000 x i32]* %6, i64 0, i64 %26
store i32 1, i32* %27
%28 = load i32, i32* %5
store i32 %28, i32* %4
br label %29
29: ; preds = %21
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
br label %17
32: ; preds = %17
store i32 1, i32* %3
br label %33
33: ; preds = %46, %32
%34 = load i32, i32* %3
%35 = load i32, i32* %2
%36 = icmp slt i32 %34, %35
br i1 %36, label %37, label %43
37: ; preds = %33
%38 = load i32, i32* %3
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [3000 x i32], [3000 x i32]* %6, i64 0, i64 %39
%41 = load i32, i32* %40
%42 = icmp ne i32 %41, 0
br label %43
43: ; preds = %37, %33
%44 = phi i1 [ false, %33 ], [ %42, %37 ]
br i1 %44, label %45, label %49
45: ; preds = %43
br label %46
46: ; preds = %45
%47 = load i32, i32* %3
%48 = add nsw i32 %47, 1
store i32 %48, i32* %3
br label %33
49: ; preds = %43
%50 = load i32, i32* %3
%51 = load i32, i32* %2
%52 = icmp eq i32 %50, %51
br i1 %52, label %53, label %58
53: ; preds = %49
%54 = load i32, i32* %2
%55 = icmp ne i32 0, %54
br i1 %55, label %56, label %58
56: ; preds = %53
%57 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %60
58: ; preds = %53, %49
%59 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %60
60: ; preds = %58, %56
br label %7
61: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
@str = [10 x i8] c"Not jolly\00"
@str.3 = [6 x i8] c"Jolly\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [3000 x i32]
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%9 = icmp sgt i64 %8, 0
br i1 %9, label %10, label %55
10: ; preds = %0
%11 = bitcast [3000 x i32]* %4 to i8*
br label %12
12: ; preds = %10, %45
%13 = load i32, i32* %1
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %45
15: ; preds = %12
%16 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2)
%17 = load i32, i32* %1
%18 = icmp sgt i32 %17, 1
br i1 %18, label %23, label %45
19: ; preds = %23
%20 = icmp sgt i32 %33, 1
br i1 %20, label %21, label %45
21: ; preds = %19
%22 = zext i32 %33 to i64
br label %35
23: ; preds = %15, %23
%24 = phi i32 [ %32, %23 ], [ 1, %15 ]
%25 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %3)
%26 = load i32, i32* %2
%27 = load i32, i32* %3
%28 = sub nsw i32 %26, %27
%29 = call i64 @abs(i32 %28)
%30 = getelementptr inbounds [3000 x i32], [3000 x i32]* %4, i64 0, i64 %29
store i32 1, i32* %30
%31 = load i32, i32* %3
store i32 %31, i32* %2
%32 = add nuw nsw i32 %24, 1
%33 = load i32, i32* %1
%34 = icmp slt i32 %32, %33
br i1 %34, label %23, label %19
35: ; preds = %21, %40
%36 = phi i64 [ 1, %21 ], [ %41, %40 ]
%37 = getelementptr inbounds [3000 x i32], [3000 x i32]* %4, i64 0, i64 %36
%38 = load i32, i32* %37
%39 = icmp eq i32 %38, 0
br i1 %39, label %43, label %40
40: ; preds = %35
%41 = add nuw nsw i64 %36, 1
%42 = icmp eq i64 %41, %22
br i1 %42, label %45, label %35
43: ; preds = %35
%44 = trunc i64 %36 to i32
br label %45
45: ; preds = %40, %43, %12, %15, %19
%46 = phi i32 [ %33, %19 ], [ %17, %15 ], [ %13, %12 ], [ %33, %43 ], [ %33, %40 ]
%47 = phi i32 [ 1, %19 ], [ 1, %15 ], [ 1, %12 ], [ %44, %43 ], [ %33, %40 ]
%48 = icmp eq i32 %47, %46
%49 = icmp ne i32 %46, 0
%50 = and i1 %49, %48
%51 = select i1 %50, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0)
%52 = call i32 @puts(i8* dereferenceable(1) %51)
%53 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%54 = icmp sgt i64 %53, 0
br i1 %54, label %12, label %55
55: ; preds = %45, %0
ret i32 0
}