128_D. Numbers_36665
One day Anna got the following task at school: to arrange several numbers in a circle so that any two neighboring numbers differs exactly by 1. Anna was given several numbers and arranged them in a circle to fulfill the task. Then she wanted to check if she had arranged the numbers correctly, but at this point her younger sister Maria came and shuffled all numbers. Anna got sick with anger but what's done is done and the results of her work had been destroyed. But please tell Anna: could she have hypothetically completed the task using all those given numbers?

Input

The first line contains an integer n — how many numbers Anna had (3 ≤ n ≤ 105). The next line contains those numbers, separated by a space. All numbers are integers and belong to the range from 1 to 109.

Output

Print the single line "YES" (without the quotes), if Anna could have completed the task correctly using all those numbers (using all of them is necessary). If Anna couldn't have fulfilled the task, no matter how hard she would try, print "NO" (without the quotes).

Examples

Input

4
1 2 3 2


Output

YES


Input

6
1 1 2 2 2 3


Output

YES


Input

6
2 4 1 1 2 2


Output

NO
n=int(input())
g={}
for i in list(map(int,input().split())):g[i]=g.get(i,0)+2
mx=max(g)
for i in sorted(g)[:-1]:
	if i+1 not in g:exit(print('NO'))
	g[i+1]-=g[i]
	if g[i+1]<0:exit(print('NO'))
print('YES'if g[mx]==0 and list(g.values()).count(0)==1else'NO')
6
1 1 2 2 2 3
 4
1 2 3 2
 6
2 4 1 1 2 2
 10
10 11 10 11 10 11 10 11 10 11
 20
2 3 4 5 6 7 8 9 8 7 6 5 4 3 2 1 5 6 5 6
 8
1 2 2 2 2 3 3 3
 4
294368194 294368194 294368194 294368195
 3
1 2 1000000000
 5
650111756 650111755 650111754 650111755 650111756
 8
1 2 3 2 3 2 3 2
 6
1 2 3 4 5 6
 5
473416369 473416371 473416370 473416371 473416370
 10
913596052 913596055 913596054 913596053 913596055 913596054 913596053 913596054 913596052 913596053
 5
6 7 6 7 6
 50
363510947 363510954 363510943 363510964 363510969 363510950 363510951 363510960 363510967 363510952 363510956 363510948 363510944 363510946 363510965 363510946 363510963 363510962 363510947 363510955 363510954 363510948 363510961 363510964 363510963 363510945 363510965 363510953 363510952 363510968 363510955 363510966 363510968 363510950 363510967 363510949 363510958 363510957 363510956 363510959 363510953 363510951 363510966 363510949 363510944 363510962 363510945 363510958 363510961 363510957
 8
5 4 3 2 1 2 3 4
 8
1 2 2 2 3 3 3 4
 4
999999998 1000000000 999999999 999999999
 16
1 2 2 2 3 3 3 4 4 5 5 5 6 6 6 7
 16
20101451 20101452 20101452 20101452 20101453 20101452 20101451 20101451 20101452 20101451 20101452 20101451 20101454 20101454 20101451 20101451
 8
1 1 2 2 5 5 6 6
 8
3 5 8 4 7 6 4 7
 13
981311157 104863150 76378528 37347249 494793049 33951775 3632297 791848390 926461729 94158141 54601123 332909757 722201692
 5
637256245 637256246 637256248 637256247 637256247
 10
10 11 10 11 7 11 10 11 10 11
 8
1 2 1 2 3 2 3 2
 20
2 3 7 5 6 7 8 9 8 7 6 5 4 3 2 1 5 6 5 6
 8
1 2 2 3 2 3 3 3
 4
294368194 548664130 294368194 294368195
 3
1 1 1000000000
 5
650111756 242204643 650111754 650111755 650111756
 6
1 2 3 4 0 6
 5
473416369 907033324 473416370 473416371 473416370
 10
913596052 913596055 1773388658 913596053 913596055 913596054 913596053 913596054 913596052 913596053
 5
6 11 6 7 6
 50
363510947 363510954 363510943 363510964 363510969 363510950 363510951 363510960 363510967 363510952 363510956 363510948 363510944 363510946 363510965 363510946 363510963 479113745 363510947 363510955 363510954 363510948 363510961 363510964 363510963 363510945 363510965 363510953 363510952 363510968 363510955 363510966 363510968 363510950 363510967 363510949 363510958 363510957 363510956 363510959 363510953 363510951 363510966 363510949 363510944 363510962 363510945 363510958 363510961 363510957
 8
5 4 3 2 1 2 3 1
 8
1 2 2 2 4 3 3 4
 4
713526911 1000000000 999999999 999999999
 16
0 2 2 2 3 3 3 4 4 5 5 5 6 6 6 7
 16
20101451 20101452 20101452 20101452 20101453 20101452 20101451 20101451 20101452 20101451 20101452 20101451 10730496 20101454 20101451 20101451
 8
1 1 2 2 5 6 6 6
 8
3 5 12 4 7 6 4 7
 13
981311157 104863150 76378528 37347249 494793049 33951775 3632297 791848390 926461729 94158141 54601123 337622303 722201692
 5
1045577431 637256246 637256248 637256247 637256247
 6
1 1 3 2 2 3
 4
2 2 3 2
 6
2 4 1 1 2 4
 10
10 11 10 10 7 11 10 11 10 11
 20
2 3 7 5 6 11 8 9 8 7 6 5 4 3 2 1 5 6 5 6
 8
1 2 2 3 2 3 6 3
 4
294368194 548664130 294368194 291482892
 3
2 1 1000000000
 5
650111756 101598586 650111754 650111755 650111756
 8
1 2 1 2 3 2 5 2
 6
0 2 3 4 0 6
 5
473416369 907033324 152783635 473416371 473416370
 10
913596052 913596055 1773388658 913596053 913596055 913596054 913596053 913596054 913596052 1540645845
 5
6 11 6 6 6
 50
363510947 363510954 363510943 363510964 363510969 363510950 363510951 363510960 363510967 363510952 363510956 363510948 363510944 363510946 363510965 363510946 363510963 479113745 363510947 363510955 363510954 363510948 363510961 363510964 363510963 363510945 363510965 363510953 363510952 363510968 363510955 363510966 344053784 363510950 363510967 363510949 363510958 363510957 363510956 363510959 363510953 363510951 363510966 363510949 363510944 363510962 363510945 363510958 363510961 363510957
 8
9 4 3 2 1 2 3 1
 8
1 2 2 2 4 4 3 4
 4
713526911 1000000000 999999999 776244905
 16
0 2 2 2 3 3 3 4 4 5 5 10 6 6 6 7
 16
20101451 20101452 20101452 20101452 20101453 20101452 20101451 20101451 20101452 20101451 20101452 20101451 10730496 20101454 35035099 20101451
 8
2 1 2 2 5 6 6 6
 8
6 5 12 4 7 6 4 7
 5
1045577431 637256246 188094898 637256247 637256247
 6
1 1 3 2 2 2
 4
2 2 4 2
 6
2 4 1 2 2 4
 10
10 8 10 10 7 11 10 11 10 11
 20
2 3 7 5 6 11 8 9 8 7 6 5 4 3 2 1 8 6 5 6
 8
1 4 2 3 2 3 6 3
 4
294368194 548664130 73485973 291482892
 3
2 1 1000000100
 5
650111756 28480204 650111754 650111755 650111756
 8
1 2 1 2 3 2 5 0
 6
0 2 3 4 1 6
 5
473416369 950646540 152783635 473416371 473416370
 5
6 11 5 6 6
 50
363510947 363510954 363510943 363510964 363510969 363510950 363510951 363510960 363510967 363510952 363510956 363510948 363510944 363510946 363510965 363510946 363510963 479113745 363510947 363510955 363510954 363510948 363510961 363510964 363510963 363510945 363510965 363510953 363510952 363510968 363510955 363510966 344053784 363510950 363510967 363510949 363510958 363510957 363510956 363510959 363510953 363510951 363510966 363510949 363510944 363510962 431463492 363510958 363510961 363510957
 8
9 4 1 2 1 2 3 1
 8
0 2 2 2 4 4 3 4
 4
713526911 1000000000 999999999 1009272130
 16
0 2 2 2 3 3 3 4 4 5 5 7 6 6 6 7

YES
 YES
 NO
 YES
 YES
 YES
 NO
 NO
 NO
 YES
 NO
 NO
 YES
 NO
 NO
 YES
 YES
 YES
 YES
 NO
 NO
 NO
 NO
 NO
 NO
 YES
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 YES
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
