n=int(input()) res=0 for x in range(1,n): if n%x==0: res+=x if res==n: print("YES") else: print("NO")