n=int(eval(input()))

def ds(n):

  return sum(map(int,str(n)))

print(('Yes' if n%ds(n)==0 else 'No'))
s=eval(input());print(('YNeos'[int(s)%sum(map(int,s))>0::2]))
n = int(eval(input()))


def ds(n):
    return sum(map(int, str(n)))


print(("Yes" if n % ds(n) == 0 else "No"))

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

-n = int(eval(input())) - - -def ds(n): -    return sum(map(int, str(n))) - - -print(("Yes" if n % ds(n) == 0 else "No")) +s = eval(input()) +print(("YNeos"[int(s) % sum(map(int, s)) > 0 :: 2]))