from collections import defaultdict

N = int(input())
A = list(map(int, input().split()))

dic = defaultdict(int)

for a in A:
    dic[a] += 1

n = len(dic.keys())
cnts = dic.values()

if n == 3:
    print('Yes')
    
else:
    print('No')