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 nn potential suspects. Every suspect told him that at the time of the crime, they were at the same place as exactly xix_{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 nn: the number of suspects. The following line contains nn integers. The ii'th integer is xix_{i}

Output

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

Constraints

  • 1n1051 \leq n \leq 10^{5}
  • 0xin10 \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 33 is claiming that at the time of crime, they were with 22 other suspects. But no other suspect is saying that they were with 22 other suspects, so there couldn't have been a group of three suspects. 33 is the culprit. At the time of crime, 33 was alone, and suspects 11 and 22 were together.

Input:

3
1 1 0

Output:

YES

Explanation:
If suspect 11 or 22 was the culprit, the other would be lying. Therefore suspect 33 must be the culprit. At the time of crime, the culprit 33 was alone, and suspects 11 and 22 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.