#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 */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, int, int, char *);
scalar_t__ scanf(char *, int *);
int main(void) {
  int n, m, i, min, max;
  while (scanf("%d", &n) != EOF) {
    min = 1001;
    max = 0;
    for (i = 0; i < n; i++) {
      scanf("%d", &m);
      if (m < min)
        min = m;
      if (m > max)
        max = m;
    }
    printf("%d %d %s\n", min, max, (max - min + 1 == n ? "yes" : "no"));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2ea2(%rip),%rcx
cmp    (%rcx),%rax
je     11f0 <main+0xd0>
movl   $0x3e9,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11b7 <main+0x97>
lea    0xe89(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1192 <main+0x72>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    11a4 <main+0x84>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    11a9 <main+0x89>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1164 <main+0x44>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x18(%rbp),%edi
sub    -0x14(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%r8d
lea    0xe40(%rip),%rcx
lea    0xe35(%rip),%rax
cmp    %r8d,%edi
cmove  %rax,%rcx
lea    0xe1d(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xece(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    0x2ea7(%rip),%rcx
cmp    (%rcx),%rax
jne    1157 <main+0x37>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xea2(%rip),%r13
lea    0x4(%rsp),%r14
mov    %rsp,%r12
jmp    11b9 <main+0x99>
nopl   0x0(%rax,%rax,1)
xor    %ebp,%ebp
mov    $0x3e9,%ebx
mov    %ebp,%ecx
sub    %ebx,%ecx
add    $0x1,%ecx
cmp    %eax,%ecx
lea    0xe8a(%rip),%rcx
lea    0xe7f(%rip),%rax
cmove  %rax,%rcx
lea    0xe6a(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <printf@plt>
mov    %r13,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
mov    0x2e34(%rip),%rcx
cmp    (%rcx),%rax
je     1146 <main+0x26>
mov    (%rsp),%eax
test   %eax,%eax
jle    1170 <main+0x50>
mov    $0x3e9,%ebx
xor    %ebp,%ebp
xor    %r15d,%r15d
nopw   0x0(%rax,%rax,1)
mov    %r13,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    %ebx,%eax
cmovl  %eax,%ebx
cmp    %ebp,%eax
cmovg  %eax,%ebp
add    $0x1,%r15d
mov    (%rsp),%eax
cmp    %eax,%r15d
jl     11d0 <main+0xb0>
jmp    1177 <main+0x57>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [10 x i8] c"%d %d %s\0A\00"
@.str.2 = [4 x i8] c"yes\00"
@.str.3 = [3 x i8] c"no\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
br label %7
7: ; preds = %33, %0
%8 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%9 = load i64, i64* @EOF
%10 = icmp ne i64 %8, %9
br i1 %10, label %11, label %45
11: ; preds = %7
store i32 1001, i32* %5
store i32 0, i32* %6
store i32 0, i32* %4
br label %12
12: ; preds = %30, %11
%13 = load i32, i32* %4
%14 = load i32, i32* %2
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %33
16: ; preds = %12
%17 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%18 = load i32, i32* %3
%19 = load i32, i32* %5
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %23
21: ; preds = %16
%22 = load i32, i32* %3
store i32 %22, i32* %5
br label %23
23: ; preds = %21, %16
%24 = load i32, i32* %3
%25 = load i32, i32* %6
%26 = icmp sgt i32 %24, %25
br i1 %26, label %27, label %29
27: ; preds = %23
%28 = load i32, i32* %3
store i32 %28, i32* %6
br label %29
29: ; preds = %27, %23
br label %30
30: ; preds = %29
%31 = load i32, i32* %4
%32 = add nsw i32 %31, 1
store i32 %32, i32* %4
br label %12
33: ; preds = %12
%34 = load i32, i32* %5
%35 = load i32, i32* %6
%36 = load i32, i32* %6
%37 = load i32, i32* %5
%38 = sub nsw i32 %36, %37
%39 = add nsw i32 %38, 1
%40 = load i32, i32* %2
%41 = icmp eq i32 %39, %40
%42 = zext i1 %41 to i64
%43 = select i1 %41, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0)
%44 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %34, i32 %35, i8* %43)
br label %7
45: ; preds = %7
ret i32 0
}

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