Problem:
 Score : 200 points    Problem Statement An integer X is called a Harshad number if X is divisible by f(X) , where f(X) is the sum of the digits in X when written in base 10 .  Given an integer N , determine whether it is a Harshad number.      Constraints  1?N?10^8  N is an integer.         Input Input is given from Standard Input in the following format:  N       Output Print Yes if N is a Harshad number; print No otherwise.        Sample Input 1 12      Sample Output 1 Yes  f(12)=1+2=3 . Since 12 is divisible by 3 , 12 is a Harshad number.       Sample Input 2 57      Sample Output 2 No  f(57)=5+7=12 . Since 57 is not divisible by 12 , 12 is not a Harshad number.       Sample Input 3 148      Sample Output 3 No

Solution (Python):

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LS()
    return l
sys.setrecursionlimit(1000000)
mod = 1000000007


def A():
    n,a,b = LI()
    print(min(n*a,b))
    return


def B():
    s = S()
    print(s.count("1"))
    return


def C():
    n = list(map(int, S()))
    k = 0
    s = sum(n)
    for i in range(len(n)):
        k *= 10
        k += n[i]
    if k%s == 0:
        print("Yes")
    else:
        print("No")
    return


def D():
    return


def E():
    return


def F():
    return


def G():
    return


def H():
    return


def I_():
    return


def J():
    return


if __name__ == "__main__":
    C()

Solution (Python):
n = int(input())
l = [int(x) for x in list(str(n))]
if n % sum(l) == 0:
  print("Yes")
else:
  print("No")

Solution (Python):
S = input()
print(["Yes", "No"][not(0 == int(S) % (sum(int(s) for s in S)))])

Solution (Python):
N=input()
print("Yes" if int(N)%sum(int(i) for i in N)==0 else "No")

Solution (Python):
def sumdigit(m):
    s=str(m)
    array=list(map(int,s))
    return sum(array)

N=int(input())
if N%sumdigit(N)==0:
    print("Yes")
else:
    print("No")

Solution (Python):
n=int(input())
s=list(str(n))
sl=[int(s[i]) for i in range(len(s))]
print("YNeos"[n%sum(sl)!=0::2])

Solution (Python):
N = int(input())

s = sum(map(int, list(str(N))))

if N % s == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
def n(num):
  ret=0
  for i in range(10):
    ret+=int((num%(10**(i+1)))/(10**i))
  return ret

a=int(input())
if a%n(a)==0:
  print('Yes')
else:
  print('No')

Solution (Python):
N = int(input())
Nsum = 0
n = N
while n > 0:
    y = n % 10
    Nsum += y
    n = n // 10
if N % Nsum == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
N = int(input())
f = sum(list(map(int, str(N))))
if N % f == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
N = int(input())
n = N
tmp = 0

while 1:
    tmp += n%10
    n = int(n/10)
    if n == 0:
        break

print('Yes' if N%tmp == 0 else 'No')

Solution (Python):
N = int(input())

result = []
memo = N
while memo > 0:
    result.append(memo % 10)
    memo //= 10

if N % sum(result) == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
N=int(input())
S=sum(map(int,list(str(N))))
if N%S==0:
    print("Yes")
else:
    print("No")

Solution (Python):
X=input()
print("Yes" if int(X)%sum(map(int,X))==0 else "No")

Solution (Python):
n=input()
print('Yes' if int(n)%eval('+'.join(list(n)))==0 else 'No')

Solution (Python):
X = int(input())
fx = sum(map(int, list(str(X))))
if (X % fx == 0):
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())

sum = 0
tmp = N
while tmp > 0:
    sum += tmp % 10
    tmp = tmp // 10
 
if N%sum==0:
    print("Yes")
else:
    print("No")

Solution (Python):
n=input()
print("Yes" if int(n)%sum(map(int,n))==0 else "No")

Solution (Python):
n = int(input())
s = str(n)
s = sum( [ int(i) for i in s  ] )
if n % s == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
n = int(raw_input())
fn = sum(list(map(int, str(n))))
if n % fn == 0:
	print 'Yes'
else:
	print 'No'

Solution (Python):
N = int(input())

def f(N):
  s = 0
  while N > 0:
    s += N%10
    N //= 10
  return s

print('Yes' if N%f(N) == 0 else 'No')

Solution (Python):
n = input().rstrip()
keta_sum = sum([int(item) for item in n])

if int(n) % keta_sum == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
N = input()

x = int(N)
fx = sum(list(map(int, list(N))))

if x%fx == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
n = input()
fx = sum(list(map(int,str(n))))
print('Yes' if int(n)%fx == 0 else 'No')

Solution (Python):
N=input()
print('Yes' if int(N)%sum(int(i) for i in N)==0 else 'No')

Solution (Python):
N=input()
T=int(N)
N=sum(map(int,N))
if T%N==0 :
  print("Yes")
else :
  print("No")

Solution (Python):
N=input()
T=int(N)
N=sum(map(int,list(N)))
if T%N==0 :
  print("Yes")
else :
  print("No")

Solution (Python):
n = input()

print("Yes" if int(n) % sum(map(int, n)) == 0 else "No")

Solution (Python):
N = int(input())
f = 0
tmp = N
for _ in range(9):
    f += N%10
    N //= 10
    if N == 0:
        break
print("Yes" if tmp % f == 0 else "No")

Solution (Python):
N = int(input())
if N % sum(map(int, str(N))) == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
def f(n):
    x=0
    while n>0:
        x+=n%10
        n//=10
    return x

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

Solution (Python):
n = int(input())
N = n
S = 0
while n>0:
    S += n%10
    n //= 10
if N%S==0:
    print("Yes")
else:
    print("No")

Solution (Python):
def solve(n):
    a = n
    b = 0
    while a != 0:
        b += a % 10
        a //= 10
    if n % b == 0:
        return 'Yes'
    else:
        return 'No'

N=int(input())
print(solve(N))

Solution (Python):
n = input()

n_ = int(n)
f = sum(map(int, list(n)))

if n_ % f == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
N = int(input())
s1 = list(str(N))
print('Yes' if N % sum(list(map(int,s1))) == 0 else 'No')

Solution (Python):
N = int(input())
n = 0
for i in str(N):
    n += int(i)

print('Yes' if N % n == 0 else 'No')

Solution (Python):
N=input()
f=0
for n in N:
    f+=int(n)
if int(N)%f==0:
    print('Yes')
else:
    print('No')

Solution (Python):
n = input()
N = list(n)
n = int(n)
ans = 0
for i in N:
    ans += int(i)
if n % ans == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
s = input()
n = int(s)
m = sum([int(_) for _ in list(s)])
print('Yes' if n%m == 0 else 'No')

Solution (Python):
N = int(input())

t = N + 0
c = 0
while 0 < t:
    c += t % 10
    t = t // 10

print("Yes" if N % c == 0 else "No")

Solution (Python):
N = input()
N_sum = 0
for i in range(len(N)):
    N_sum += int(N[i])

print("Yes" if int(N) % N_sum == 0 else "No")

Solution (Python):
n = input()
x = False
if int(n) % sum([int(c) for c in list(str(n))]) == 0:
    x = True
ans = 'Yes' if x else 'No'
print(ans)

Solution (Python):
a=input()
b=int(a)
c=0
for i in range(len(a)):
  c+=int(a[i])
if b%c==0:
  print("Yes")
else:
  print("No")

Solution (Python):
N = input()
num = 0
ans = False
for i in N:
    num += int(i)
    if int(N) % num == 0:
        ans = True
    else:
        ans = False
print('Yes' if ans else 'No')

Solution (Python):
N = int(input())

x = N
f = 0
while x != 0:
    f += x % 10
    x //= 10
print('Yes' if N % f == 0 else 'No')

Solution (Python):
n = int(input())
arr = list(str(n))
_sum = sum(map(int, arr))
if n % _sum == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
def f(x):
    res=0
    for s in x:
        res+=int(s)
    return res

N=input()
if int(N)%f(N)==0:
    print("Yes")
else :
    print("No")

Solution (Python):
def solve(string):
    n = string
    return "Yes" if int(n) % sum(map(int, n)) == 0 else "No"


if __name__ == '__main__':
    print(solve(input()))

Solution (Python):
n=input()
count=0
ans='No'
for i in range(len(n)):
    count+=int(n[i])
if int(n)%count==0:
    ans='Yes'
print(ans)

Solution (Python):

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

Solution (Python):

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007


def A():
    n,a,b = LI()
    print(min(n*a,b))
    return


def B():
    n = list(map(int,S()))
    s = sum(n)
    a = 0
    for i in n:
        a *= 10
        a += i
    if a%s == 0:
        print("Yes")
    else:
        print("No")
    return


def C():
    n = I()
    f = LIR(n)
    po = [1]*11
    for i in range(n):
        k = 0
        p = 1
        for j in range(10):
            k += p*f[i][j]
            p *= 2
            po[j+1] = p
        f[i] = k
    p = LIR(n)
    ans = -float("inf")
    for i in range(1,1024):
        k = 0
        for j in range(n):
            c = i&f[j]
            s = 0
            for l in po:
                if c&l:s += 1
            k += p[j][s]
        ans = max(ans,k)
    print(ans)

def D():
    n,C = LI()
    T = [[0 for i in range(100002)] for j in range(C)]
    for i in range(n):
        s,t,c = LI()
        c -= 1
        T[c][s] += 1
        T[c][t+1] -= 1
    for c in range(C):
        for i in range(100000):
            T[c][i+1] += T[c][i]
    ans = 0
    for i in range(100000):
        k = 0
        for c in range(C):
            if T[c][i]:k += 1
        ans = max(ans, k)
    print(ans)

def E():
    return


def F():
    return


def G():
    return


def H():
    return


if __name__ == "__main__":
    B()

Solution (Python):


n = int(input())

def digit_list(num):
    num = str(num)
    num = list(num)
    num = list(map(int,num))
    return num

if n % sum(digit_list(n)) == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
N = input()
f = 0
for i in range(len(N)):
    f += int(N[i])
if int(N) % f == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
n=input()
hoge=list(n)
n=int(n)
a=0
for i in range(len(hoge)):
  a+=int(hoge[i])
  
if(n%a==0):
  print("Yes")
else:
  print("No")

Solution (Python):
x = input()
f = list(x)
f = sum([int(i) for i in f])
x = int(x)
if x % f == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
num = input()
l = list(map(int, num))
n_sum = sum(l)
if int(num)%n_sum==0:
  print("Yes")
else:
  print("No")

Solution (Python):
N = input()

f_n = 0
for n in N:
  f_n += int(n)

if int(N) % f_n == 0:
  print('Yes')
else:
  print('No')

Solution (Python):
N = str(input())
len_N = len(N)
cnt = 0
for i in range(len_N):
    cnt += int(N[i])
if int(N) % cnt == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
S = input()
fX = sum(int(c) for c in S)
X = int(S)
print("Yes" if X%fX == 0 else "No")

Solution (Python):
n=input()
sum=0
for i in n:
  sum+=int(i)

if int(n)%sum==0:
  print("Yes")
else:
  print("No")

Solution (Python):
from sys import stdin
n = list(stdin.readline().rstrip())
if int(''.join(n))%sum(list(map(int, n)))==0:
    print('Yes')
else:
    print('No')

Solution (Python):
N = int(input()) 
F = 0
for i in (str(N)):
    F += int(i)
print("Yes" if N % F == 0 else "No")

Solution (Python):

n = int(input())
fn = 0
temp = n
while temp>0:
    fn += temp%10
    temp = temp//10
if(n%fn==0):
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())
n = list(map(int,str(N)))
if N % sum(n) == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())
temp = N
test = 0
while temp > 0:
  test += temp %10
  temp //= 10
if N % test == 0:
  print('Yes')
else:
  print('No')

Solution (Python):
N = int(input())
n=N
f = 0
while n>0:
  f += n%10
  n //=10

if N %f ==0:
  print('Yes')
else:
  print('No')

Solution (Python):


N =str(input())

ans =0
for i in N:
    ans+=int(i)
if int(N)%ans==0:
    print('Yes')
else:
    print('No')

Solution (Python):
N = int(input())
num = N
div = 0
while num > 0:
    div += (num % 10)
    num //= 10
if N%div == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
x= list(map(int, input().split()))




y = str(x[0])
array = list(map(int, list(y)))



if x[0] % sum(array) ==0:
  print("Yes")
else:
  print("No")

Solution (Python):
x = int(input())
fx = 0
tmp = x
while tmp > 0:
  fx += tmp - tmp // 10 * 10
  tmp = tmp // 10
print("Yes" if x % fx == 0 else "No")

Solution (Python):
N=input()
N_list=map(int, list(N))


if int(N)%sum(N_list)==0:
    print("Yes")
else:
    print("No")

Solution (Python):
s = input()
n = int(s)
each_n = [int(i) for i in s]
sum_n = sum(each_n)
if n % sum_n == 0:
  print('Yes')
else:
  print('No')

Solution (Python):
n = input()
s = 0
for i in range(len(n)):
    s += int(n[i])

if int(n)%s == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
n = str(input())
fn = 0
for i in range(0,len(n)):
  fn += int(n[i])
if int(n)%fn==0:
  print("Yes")
else:
  print("No")

Solution (Python):
def f(x):
  a,b=0,str(x)
  for i in range(len(b)):a+=int(b[i])
  return a
n=int(input())
print("Yes"if n%f(n)==0 else"No")

Solution (Python):
n = int(input())
s = str(n)
ans = 0
for i in s:
    ans += int(i)
if n%ans==0:
    print("Yes")
else:
    print("No")

Solution (Python):
n=int(input())
l=[int(c) for c in str(n)]
f=sum(l)
if n%f==0:
    print("Yes")
else:
    print("No")

Solution (Python):
N = input()
total = 0
for i in N:
    total += int(i)
if int(N) % total == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
import itertools
import numpy as np
import sys
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
mod = 1000000007
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
n = list(map(int,[i for i in str(N)]))

if N%sum(n)==0:
    print("Yes")
else:
    print("No")

Solution (Python):
def num(x):
  ans=0
  while x>0:
    ans+=x%10
    x=x//10
  return ans
n=int(input())
if n%num(n)==0:
  print('Yes')
else:
  print('No')

Solution (Python):
n_list = list(input())
n_sum = sum(list(map(int,n_list)))
if int(''.join(n_list))%n_sum == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
m=input()

sum=0
for i in range(len(m)):
  sum=sum+int(m[i])

if int(m)%sum==0:
  print("Yes")
else:
  print("No")

Solution (Python):
N = int(input())

f_x = 0
n = N
while n > 0:
    f_x += n % 10
    n //= 10
ans = (N % f_x) == 0

print("Yes" if ans else "No")

Solution (Python):
N = input()
a = sum([int(x) for x in N])
if int(N) % a == 0:
    print('Yes')
else:
    print('No')

Solution (Python):



n = input()
s = 0
for i in n:
    s += int(i)
print('Yes' if int(n) % s == 0 else 'No')

Solution (Python):
n=input()
a=int(n)
num=0
for i in range(len(n)):
  num+=int(n[i])
if a%num==0:
  print('Yes')
else:
  print('No')

Solution (Python):
N=int(input())
print('Yes') if N%(sum([int(x) for x in list(str(N))]))==0 else print('No')

Solution (Python):
x=int(input())
s=str(x)
keta=0
for i in s:
  keta+=int(i)
if x%keta==0:
  ans='Yes'
else:
  ans='No'
print(ans)

Solution (Python):

import copy
import numpy as np
import random


n = int(input())
n_list = list(str(n))

x = 0
for digit in n_list:
    x += int(digit)

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

Solution (Python):
n = int(input())
k = n
s = 0

while k != 0:
    s += k % 10
    k = k // 10
    
if n % s == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
N = input()
tot = 0
for i in range(len(N)):
    tot += int(N[i])

if int(N) % tot == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
N = input()
tot = 0
for i in range(len(N)):
    tot += int(N[i])

if int(N) % tot == 0:
    print("Yes")
else:
    print("No")

Solution (Python):


import itertools
import collections
import bisect

def main():
    N = int(input())
    s = sum(map(int, list(str(N))))
    print("Yes" if N % s == 0 else "No")

if __name__ == '__main__':
    main()

Solution (Python):
n = input()
f = 0
for x in n:
  f += int(x)
if int(n) % f:
  print("No")
else:
  print("Yes")

Solution (Python):
N=input()
print('Yes'if int(N)%sum(list(map(int,list(N))))==0 else'No')

Solution (Python):
N = int(input())
print('Yes' if N % sum(list(map(int, list(str(N))))) == 0 else 'No')

Solution (Python):
def f(x: int) -> int:
    s = 0
    while x > 0:
        s += x % 10
        x //= 10
    return s


def harshad_number(N: int) -> bool:
    return N % f(N) == 0


if __name__ == "__main__":
    N = int(input())
    yes = harshad_number(N)
    print('Yes' if yes else 'No')

Solution (Python):
N = input()
print("Yes" if int(N) % sum([int(i) for i in N]) == 0 else "No")

Solution (Python):
def f(x):
  if x <= 0:
    return 0
  return (x%10)+f(x//10)

n = int(input())
fx = f(n)
ans = "Yes" if n % fx == 0 else "No"
print (ans)

Solution (Python):
x=input()
sum=0
for a in x:
    sum+=int(a)
if int(x)%sum==0:
    print("Yes")
else:
    print("No")

Solution (Python):
s=input();print('YNeos'[int(s)%sum(map(int,s))>0::2])

Solution (Python):
import sys

def main():
    input = sys.stdin.readline
    N = int(input())
    n = N

    f = 0
    while n > 0:
        f += n % 10
        n //= 10

    if N % f == 0:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
f = sum(list(map(int, str(N))))
if N % f == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
N = input()
if int(N) % sum(map(int, N)) == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
n = int(input())
s = str(n)
f = 0
for i in s:
    f += int(i)

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

Solution (Python):
N = input()
Ns = [int(i) for i in N]
if  int(N)%sum(Ns)==0:
    print("Yes")
else:
    print("No")

Solution (Python):

N = int(input())


cnt = 0
n = N
while n > 0:
  cnt += n % 10
  n //= 10


if N % cnt == 0:
  print("Yes")
else:
  print("No")

Solution (Python):
def sum_digits(n):
    s = 0
    while n:
        s += n % 10
        n //= 10
    return s


N = int(input())
if N % sum_digits(N) == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())
s = 0
for c in str(N):
    s += int(c)
print("YNeos"[N % s != 0::2])

Solution (Python):
n = input()
sum = 0
for i in range(len(n)):
  sum += int(n[i])
if int(n) % sum == 0:
  print("Yes")
else:
  print("No")

Solution (Python):
N = int(input())
if N % sum(list(map(int,list(str(N))))) == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
n = input()
print("Yes" if int(n) % sum(list(map(int,list(n)))) == 0 else "No")

Solution (Python):
N = int(input())
ans = "No"
if(N%sum(map(int,str(N))) == 0):
  ans = "Yes"
print(ans)

Solution (Python):
n = int(input())

def calc(num):
    total = 0
    while num > 0:
        total += num % 10
        num = num // 10
    return total

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

Solution (Python):
def main():
    N = int(input())
    total = 0
    x = N
    while x > 0:
        total += x % 10
        x //= 10
    if N % total == 0:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

Solution (Python):
N = input()
n = map(int, list(N))
if int(N) % sum(n) == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
n=input()

fx=sum([int(i) for i in n])
if int(n)%fx==0:
    print("Yes")
else:
    print("No")

Solution (Python):
ns = input()
n = int(ns)
nsum = sum(list(map(int, list(ns))))
if n % nsum: print('No')
else: print('Yes')

Solution (Python):
N = input()
Nint = int(N)
fN = 0

for i in range(len(N)):
    fN += int(N[i])

if Nint % fN == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
ri = lambda: int(input())
rl = lambda: list(map(int,input().split()))
rr = lambda N: [ri() for _ in range(N)]
YN = lambda b: print('YES') if b else print('NO')
yn = lambda b: print('Yes') if b else print('No')
OE = lambda x: print('Odd') if x%2 else print('Even')
INF = 10**18

N=input()
fn = 0
for n in N:
    fn += int(n)

yn(int(N)%fn==0)

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

N = input()[:-1]
dig = 0
for c in N:
    dig += int(c)
if int(N) % dig == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
N = input()
X = int(N)
n = list(N)
sum = 0

for i in range(len(n)):
  n[i] = int(n[i])
  sum += n[i]
  
if(X%sum == 0):
  print('Yes')
else:
  print('No')

Solution (Python):
n = int(input())
x = sum([int(i) for i in list(str(n))])
if n % x:
  print("No")
else:
  print("Yes")

Solution (Python):
n = input()
nl = list(n)
n = int(n)

sum = 0
for i in range(len(nl)):
    sum += int(nl[i])

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

Solution (Python):
n=list(input())
m=int("".join(n))
sum=0
for i in range(len(n)):
    sum+=int(n[i])
print("Yes" if m%sum==0 else "No")

Solution (Python):
n=int(input())
def ds(n):
  return sum(map(int,str(n)))
print('Yes' if n%ds(n)==0 else 'No')

Solution (Python):

S = list(input())
s = sum([int(i) for i in S])
S = int(''.join(S))
print(['No', 'Yes'][S % s == 0])

Solution (Python):

N=input()
sum=0
for i in N:
    sum+=int(i)
if(int(N)%sum==0):
    print("Yes")
else:
    print("No")

Solution (Python):
hoge=input()
n=[int(i) for i in hoge]
print("Yes" if int(hoge)%sum(n)==0 else "No")

Solution (Python):
N = list(input())
n = int(''.join(N))
s = eval('+'.join(N))

if n % s == 0: print('Yes')
else: print('No')

Solution (Python):
n=int(input())

x=str(n)
y=0
for i in range(len(x)):
    y+=int(x[i])

if n%y==0:
    print('Yes')
else:
    print('No')

Solution (Python):
A = int(input())
N = A
a = []
for i in reversed(range(len(str(N)))):
	a.append(int(N/10**(i)))
	N -= int(N/10**i)*10**i
X = sum(a)
if A % X == 0:
	print("Yes")
else:
	print("No")

Solution (Python):
N=input()
s=sum([int(i) for i in N])

print('Yes' if int(N)%s==0 else 'No')

Solution (Python):
N=input()
f=0
n=int(N)
for i in range(len(N)):
    f+=int(N[i])
if n%f==0:
    print("Yes")
else:
    print("No")

Solution (Python):
n = int(input())
f = sum([int(i) for i in str(n)])

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

Solution (Python):
N = input()
sum = 0
for i in N:
    sum += int(i)
if int(N) % sum == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
x = input()
FX = 0
for numb in x:
  FX += int(numb)
print("Yes" if int(x) % FX == 0 else "No")

Solution (Python):
n = input()
fx = sum([int(i) for i in list(n)])
if int(n) % fx == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
n = int(input())
x = n
y = 0
while n > 0:
    y += n%10
    n //= 10

if x%y == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
n = int(input())

mod = sum(int(list(str(n))[i]) for i in range(len(str(n))))

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

Solution (Python):
N = input()

sum = 0
for i in N:
    sum += int(i)

if int(N) % sum == 0: print( 'Yes' )
else: print( 'No' )

Solution (Python):
n = input()
fn = 0
for i in range(len(n)):
    fn += int(n[i])
print('Yes') if int(n)%fn == 0 else print('No')

Solution (Python):
N=int(input())
s=N
t=0
while s>0:
    t+=s%10
    s=(s-s%10)//10
if N%t==0:
    print('Yes')
else:
    print('No')

Solution (Python):
N=input()
a=0
for i in N:
  a+=int(i)
print("Yes") if int(N)%a==0 else print("No")

Solution (Python):
def f(x: int):
    sum = 0
    for s in str(x):
        sum += int(s)
    return sum


n = int(input())
print("Yes") if n % f(n) == 0 else print("No")

Solution (Python):
N = int(input())
p = N
sums = 0
while p >= 1:
    sums += p%10
    p //= 10
if (N % sums) == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())

def Harshad(n):
    s = str(n)
    sum = 0
    for i in range(len(s)):
        sum += int(s[i])

    if n%sum == 0:
        return True
    else:
        return False

D = Harshad(N)

if D:
    print('Yes')
else:
    print('No')

Solution (Python):
N = input()
sum = 0
for i in range(0,len(N),1):
  sum += int(N[i])
if int(N)%sum == 0:
  print("Yes")
else:
  print("No")

Solution (Python):
N = input()

nn = 0
for i in range(len(N)):
    nn += int(N[i])

if int(N) % nn == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
n = input()
ans = sum(map(int, n))
if int(n)%ans == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
def is_harhed_number(x):
    y = x
    numbox = []
    while y >= 10:
        p = y % 10
        numbox.append(p)
        y //= 10
    if (x % (y + sum(numbox))) == 0:
        return 'Yes'
    else:
        return 'No'
N = int(input())
print(is_harhed_number(N))

Solution (Python):
n = int(input())
x = 0

for i in str(n):
    x += int(i)

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

Solution (Python):
n = input()
f_x=0
for i in range(len(n)):
    f_x+=int(n[i])
if int(n)%f_x==0:
    print('Yes')
else:
    print('No')

Solution (Python):
x = input()
sum = 0

for i in range(len(x)):
  sum += int(x[i])
  
if int(x) % sum == 0:
  print("Yes")
else:
  print("No")

Solution (Python):
N = int(input())
def f(N):
    N_string = str(N)
    N_integer = [int(i) for i in N_string]
    N_sum = sum(N_integer)
    return(N_sum)
if(N%f(N)==0):
    print('Yes')
else:
    print('No')

Solution (Python):
x=input()
f=0
for i in range(len(x)):
    f+=int(x[i])
if int(x)%f==0:
    print("Yes")
else:
    print("No")

Solution (Python):
def ten_sum(n):
    s = 0
    while n > 0:
        s += n % 10
        n = math.floor(n / 10)
    return s



import math
N = int(input())
num = ten_sum(N)

if N % num == 0:
    print("Yes")
else:
    print("No")

Solution (Python):

n=int(input())
d_n=n
f=0

while(n!=0):
	f+=n%10
	n=int(n/10)

if(d_n%f==0):
	print("Yes")
else:
	print("No")

Solution (Python):
m = n = int(input())
s = 0
while n >= 1:
  s += n % 10
  n //= 10
print('Yes') if m % s == 0 else print('No')

Solution (Python):
s=input();print('YNeos'[int(s)%sum(map(int,s))>0::2])

Solution (Python):
s=input();print('YNeos'[int(s)%sum(map(int,s))>0::2])

Solution (Python):
n=input()
l=[int(n[i]) for i in range(len(n))]
print('Yes') if int(n) % sum(l) == 0 else print('No')

Solution (Python):
x=input();print("YNeos"[int(x)%sum(map(int,x))!=0::2])

Solution (Python):
n = int(input())
if n % sum(map(int, list(str(n)))) == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
N = input()
B = []
for n in N:
    B.append(int(n))
if int(N)%sum(B)==0:
    print('Yes')
else:
    print('No')

Solution (Python):
N = input()
if(int(N)%sum(list(map(int,N))) == 0):
  print("Yes")
else:
  print("No")

Solution (Python):
n=input()
f=0

for i in range(len(n)):
    f+=int(n[i])

if int(n)%f:
    print('No')
else:
    print('Yes')

Solution (Python):
x = int(input())

def f(x):
  n = len(str(x))
  clasSum = 0
  for i in range(n):
    s = str(x)[i]
    clasSum += int(s)
  return clasSum
if x % f(x) == 0:
  print("Yes")
else:
  print("No")

Solution (Python):
""" AtCoder """

N = int(input())

fN = sum(list(map(int, str(N))))

if N % fN == 0:
    print("Yes")
else:
    print("No")

Solution (Python):

n = int(input())
if n%sum([int(c) for c in str(n)]) == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
def isHarshad(x):
    s = str(x)

    num = 0

    for c in s:
        num += int(c)

    return True if x % num == 0 else False


N = int(input())
print("Yes" if isHarshad(N) else "No")

Solution (Python):
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions

def j(q):
    if q==1: print("Yes")
    else:print("No")
    exit(0)


def ct(x,y):
    if (x>y):print("")
    elif (x<y): print("")
    else: print("")

def ip():
    return int(input())







a = input()                                   







s = 0
for i in range(len(a)):
    s+= int(a[i])
j(int(a)%s ==0)

Solution (Python):
n = int(input())
if n % sum(map(int, list(str(n)))) == 0:
  print("Yes")
else:
  print("No")

Solution (Python):
N = int(input())
s = N
t = 0
while s != 0:
    t += s % 10
    s //= 10
if N % t == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
n = int(input())
m = sum(list(map(int,list(str(n)))))
if n % m == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
n=input()
_sum=0
for i in range(len(n)):
    _sum+=int(n[i])
print('Yes') if int(n)%_sum==0 else print('No')

Solution (Python):
N=(input())
sum=0
for i in range(len(N)):
    sum+=int(N[i])

print("Yes"if int(N)%sum==0 else"No")

Solution (Python):
N = input()

f = sum([int(i) for i in N])

if int(N) % f == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
N = int(input())
def func(n):
    res = 0
    while n > 0:
        res += n % 10
        n //= 10
    return res
if N % func(N) == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
def sumDigit(i):
  if i > 0:
    return sumDigit(i // 10) + i % 10
  else:
    return 0

n = int(input())
print('Yes' if n % sumDigit(n) == 0 else 'No')

Solution (Python):
n=int(input())
m=sum(list(map(int,list(str(n)))))
if n%m:
    print('No')
else:
    print('Yes')

Solution (Python):

import sys

N = int(input())

def getAns(n) :
    total = 0
    wkN = n
    while wkN > 0 :
        total = total + (wkN % 10)
        wkN = wkN // 10
    if n % total == 0 :
        return "Yes"
    else :
        return "No"

print(getAns(N))

Solution (Python):
x = input()
a = 0
for i in range(len(x)):
    a += int(x[i])

if int(x)%a==0:
    print('Yes')
else:
    print('No')

Solution (Python):
N = input()
if(int(N)%sum(list(map(int,N))) == 0):
  print("Yes")
else:
  print("No")

Solution (Python):
int_n = int(input())

if int_n % sum([int(s) for s in str(int_n)]) == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
n=input()
x=int(n)
fx=sum([int(i) for i in list(n)])
print("Yes") if x%fx==0 else print("No")

Solution (Python):
n = input()
num = int(n)

summation=0
for i in range(len(n)):
  summation += int(n[i])
  
print("Yes" if num%summation ==0 else "No")

Solution (Python):
Ns=input()
N=int(Ns)
fX=0
for s in Ns:
  fX+=int(s)
if N%fX==0:
  print('Yes')
else:
  print('No')

Solution (Python):
s = input()
print("Yes" if int(s) % sum(map(int, list(s))) == 0 else "No")

Solution (Python):
N = int(input())
S = str(N)

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

Solution (Python):
N = input()
i = 0
for x in N:
  i += int(x)
if int(N) % i == 0:
  print("Yes")
else:
  print("No")

Solution (Python):
N=int(input())
S=sum(map(int,str(N)))

if(N%S==0):
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())

def calcSumOfDigits(N):
    sum = 0
    for s in str(N):
        sum += int(s)
    return sum

sum = calcSumOfDigits(N)
if N%sum == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
str       = input()
input_val = int(str)
sum = 0

for i in str:
    sum += int(i)

mod = divmod(input_val ,sum)
mod = mod[1]

if mod == 0:
    print('Yes')
else:
    print('No')