#OLD240. problem01

problem01

Description

Today, hedgehog Filya went to school for the very first time! Teacher gave him a homework which Filya was unable to complete without your help.

Filya is given an array of non-negative integersa1,a2, ...,an. First, he pick an integerxand then he addsxto some elements of the array (no more than once), subtractxfrom some other elements (also, no more than once) and do no change other elements. He wants all elements of the array to be equal.

Now he wonders if it's possible to pick such integerxand change some elements of the array using thisxin order to make all elements equal.

Format

Input

The first line of the input contains an integern(1 ≤n≤ 1 000) — the number of integers in the Filya's array. The second line containsnintegersa1,a2, ...,an(0 ≤ai≤ 109) — elements of the array.

Output

If it's impossible to make all elements of the array equal using the process given in the problem statement, then print "NO" (without quotes) in the only line of the output. Otherwise print "YES" (without quotes).

Samples

5
1 3 3 2 1
5
1 2 3 4 5
YES
NO

Hint