#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 */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, a, t;
  int flag = 1;
  scanf("%d", &n);
  scanf("%d", &t);
  for (int i = 0; i < n - 1; ++i) {
    scanf("%d", &a);
    if (t != a) {
      flag = 0;
    }
  }
  printf("%d\n", flag);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x14(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeb3(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11a4 <main+0x84>
lea    0xe8b(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1191 <main+0x71>
movl   $0x0,-0x14(%rbp)
jmp    1196 <main+0x76>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    115d <main+0x3d>
mov    -0x14(%rbp),%esi
lea    0xe55(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xecd(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    $0x1,%ebx
cmpl   $0x2,0x4(%rsp)
jl     1195 <main+0x75>
mov    $0x1,%ebx
xor    %r12d,%r12d
lea    0xe98(%rip),%r14
lea    0xc(%rsp),%r15
xor    %ebp,%ebp
nop
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
cmp    0xc(%rsp),%eax
cmovne %r12d,%ebx
add    $0x1,%ebp
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    %eax,%ebp
jl     1170 <main+0x50>
lea    0xe67(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %5
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
store i32 0, i32* %6
br label %9
9: ; preds = %21, %0
%10 = load i32, i32* %6
%11 = load i32, i32* %2
%12 = sub nsw i32 %11, 1
%13 = icmp slt i32 %10, %12
br i1 %13, label %14, label %24
14: ; preds = %9
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%16 = load i32, i32* %4
%17 = load i32, i32* %3
%18 = icmp ne i32 %16, %17
br i1 %18, label %19, label %20
19: ; preds = %14
store i32 0, i32* %5
br label %20
20: ; preds = %19, %14
br label %21
21: ; preds = %20
%22 = load i32, i32* %6
%23 = add nsw i32 %22, 1
store i32 %23, i32* %6
br label %9
24: ; preds = %9
%25 = load i32, i32* %5
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %25)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%9 = load i32, i32* %1
%10 = icmp sgt i32 %9, 1
br i1 %10, label %14, label %11
11: ; preds = %14, %0
%12 = phi i32 [ 1, %0 ], [ %21, %14 ]
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
14: ; preds = %0, %14
%15 = phi i32 [ %22, %14 ], [ 0, %0 ]
%16 = phi i32 [ %21, %14 ], [ 1, %0 ]
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%18 = load i32, i32* %3
%19 = load i32, i32* %2
%20 = icmp eq i32 %18, %19
%21 = select i1 %20, i32 %16, i32 0
%22 = add nuw nsw i32 %15, 1
%23 = load i32, i32* %1
%24 = add nsw i32 %23, -1
%25 = icmp slt i32 %22, %24
br i1 %25, label %14, label %11
}