a=eval(input());print(('YNeos'[int(a)%sum([int(i) for i in a])!=0::2]))
a=eval(input());print(('YNeos'[int(a)%sum(map(int,a))!=0::2]))
a = eval(input())
print(("YNeos"[int(a) % sum([int(i) for i in a]) != 0 :: 2]))

a = eval(input())
print(("YNeos"[int(a) % sum(map(int, a)) != 0 :: 2]))

-print(("YNeos"[int(a) % sum([int(i) for i in a]) != 0 :: 2])) +print(("YNeos"[int(a) % sum(map(int, a)) != 0 :: 2]))