CSES - KILO 2018 3/5 - Detective Debut
  • Time limit: 2.00 s
  • Memory limit: 512 MB

Uolevi has always dreamed of becoming a great detective like his childhood hero Hercules Potato. This spring his dreams have finally come true as after five years of work he has finally graduated from his local police department's detective program! What adventure awaits him now?

His detective debut has taken him to a local bakery, where an outrageous crime has been committed: Someone has stolen all the cookies!

By following trails of footsteps from the bakery's cookie vault, Uolevi has found n potential suspects. Every suspect told him that at the time of the crime, they were at the same place as exactly x_{i} other suspects.

One of the suspects is the culprit, all other suspects are guaranteed to be speaking the truth. At the time of crime, the culprit was alone in the vault, but they may lie and say they were with any amount of other suspects.

Uolevi wants to know whether it is possible to uniquely identify who the culprit is based on only this information.

Input

The first line contains an integer n: the number of suspects. The following line contains n integers. The i'th integer is x_{i}

Output

Output YES if it is possible to uniquely identify the culprit. Otherwise output NO. It is guaranteed that one of the n suspects is the culprit, and all other suspects are speaking the truth.

Constraints

  • 1 \leq n \leq 10^{5}
  • 0 \leq x_{i} \leq n-1

Example

Input:

3
1 1 1

Output:

NO

Explanation:
Any one of the three suspects could be the culprit. At the time of crime, the culprit was alone, and the other two suspects were together.

Input:

3
1 1 2

Output:

YES

Explanation:
Suspect 3 is claiming that at the time of crime, they were with 2 other suspects. But no other suspect is saying that they were with 2 other suspects, so there couldn't have been a group of three suspects. 3 is the culprit. At the time of crime, 3 was alone, and suspects 1 and 2 were together.

Input:

3
1 1 0

Output:

YES

Explanation:
If suspect 1 or 2 was the culprit, the other would be lying. Therefore suspect 3 must be the culprit. At the time of crime, the culprit 3 was alone, and suspects 1 and 2 were together.

Input:

3
0 0 0

Output:

NO

Explanation:
Any one of the three suspects could be the culprit. At the time of crime, everyone was alone.