#wrong average n,a=(int(i) for i in input().split()) x=[int(i) for i in input ().split()] S=0 for i in range(n): S+=x[i] if a ==S//n: print("YES") else: print("NO")