X=lambda:map(int,input().split()) A,B=X() print("YNEOS"[sum(list(X()))!=A*B::2])