# -*- coding: utf-8 -*-
"""
Created on Sun Jun 14 17:34:27 2020

@author: NEC-PCuser
"""

N = int(input())
a = list(map(int, input().split()))
a_len = len(a) + 1
ng_flg = False
while a_len >= 2:
    if a_len % 2 != 0:
        ng_flg = True
        break
    a_len = a_len // 2
        
if ng_flg is True:
    print("No")
else:
    a.sort()
    j = 0
    ans = "Yes"
    for i in range(len(a)):
        if i != j:
            ans = "No"
            break
        j += 1
    
    print(ans)