# your code goes here

n = int(eval(input()))

N = str(n)

N = [int(x) for x in N]

if n%sum(N)==0:

	print("Yes")

else:

	print("No")

x = eval(input())

k=0

for i in x:

    k+=int(i)



if int(x)%k==0:

    print("Yes")

else:

    print("No")



    

# your code goes here
n = int(eval(input()))
N = str(n)
N = [int(x) for x in N]
if n % sum(N) == 0:
    print("Yes")
else:
    print("No")

x = eval(input())
k = 0
for i in x:
    k += int(i)
if int(x) % k == 0:
    print("Yes")
else:
    print("No")

-# your code goes here -n = int(eval(input())) -N = str(n) -N = [int(x) for x in N] -if n % sum(N) == 0: +x = eval(input()) +k = 0 +for i in x: +    k += int(i) +if int(x) % k == 0: