a,b=map(int,input().split()) c=sum(list(map(int,input().split()))) if a*b==c: print("YES") else: print("NO")