n,m=map(int,input().split()) x=map(int,input().split()) if sum(x)==n*m: print("YES") else: print("NO")