def digit10(x):

    dten = 0

    while(x>0):

        dten+=int(x%10)

        x/=10

    return dten



n = int(eval(input()))

if n%digit10(n)==0:

    print("Yes")

else:

    print("No")
S = eval(input())

N = int(S)

fn = 0

for i in range(len(S)):

    fn += int(S[i])

print(("Yes" if N % fn == 0 else "No"))
def digit10(x):
    dten = 0
    while x > 0:
        dten += int(x % 10)
        x /= 10
    return dten


n = int(eval(input()))
if n % digit10(n) == 0:
    print("Yes")
else:
    print("No")

S = eval(input())
N = int(S)
fn = 0
for i in range(len(S)):
    fn += int(S[i])
print(("Yes" if N % fn == 0 else "No"))

-def digit10(x): -    dten = 0 -    while x > 0: -        dten += int(x % 10) -        x /= 10 -    return dten - - -n = int(eval(input())) -if n % digit10(n) == 0: -    print("Yes") -else: -    print("No") +S = eval(input()) +N = int(S) +fn = 0 +for i in range(len(S)): +    fn += int(S[i]) +print(("Yes" if N % fn == 0 else "No"))