N,K=map(int,input().split()) A=list(map(int,input().split())) if K*len(A)==sum(A): print("YES") else: print("NO")