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-----
12

-----Sample Output-----
Yes

f(12)=1+2=3. Since 12 is divisible by 3, 12 is a Harshad number.

Difficulty: introductory

Starter code:

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


#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**6)

n = int(input())

fx = sum([int(i) for i in str(n)])


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


n = str(input())
a = []
for i in n:
    a.append(int(i))
b = sum(a)
if int(n) % b == 0:
    print('Yes')
else:
    print('No')

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

def main():
    N = int(input())
    s = list(str(N))
    H = 0
    for i in range(len(s)):
        H += int(s[i])
    if N % H == 0:
        print('Yes')
    else:
        print('No')
    
main()


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

n = input()
s = sum(map(int, list(n)))
print('Yes' if int(n) % s ==0 else 'No')

a=input()
y=[]
for i in range(len(a)):
    y.append(int(a[i]))
if int(a)%sum(y)==0:
    print("Yes")
else:
    print("No")

N = int(input())
l = list(str(N))
fx = 0
for i in l:
  fx += int(i)
if N%fx == 0:
  print("Yes")
else:
  print("No")

N = int(input())
strN = str(N)

keta_wa = 0

for i in range(len(strN)):
  keta_wa += int(strN[i])
  
if N % keta_wa == 0:
  print('Yes')
else:
  print('No')

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

n = int(input())
s = str(n)
sum = 0
for i in range(len(s)):
    sum+=(ord(s[i])-ord('0'))
if n%sum == 0:
    print("Yes")
else:
    print("No")

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

N = input()

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

N = input()

def f(x):
   result = 0
   for i in range(len(x)):
      result += int(x[i])
   return result

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

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

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


ipp = input()
n = [int(x) for x in ipp]
harshad = 0

for i in range(0, len(n)):
    harshad += n[i]

if int(ipp) % harshad == 0:
    print("Yes")
elif int(ipp) % harshad != 0:
    print("No")

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

n = int(input())

nn = str(n)
ha_num = 0
for i in nn:
    ha_num += int(i)

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

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

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

n = input()
n_int = int(n)

n_sum = 0

for s in n:
    n_sum += int(s)

if(n_int%n_sum == 0):
    print("Yes")
else:
    print("No")

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

N = input()
f = lambda X:sum(int(x) for x in X)
print(('Yes' if int(N)%f(N) == 0 else 'No'))


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

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

n = input()

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

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

a = input()
x = [int(i) for i in a]
print("Yes" if int(a) % sum(x) == 0 else "No")

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

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

N=int(input())
x=str(N)
s=0
for i in range(len(x)):
    s+=int(x[i])
if N % s==0:
    ans="Yes"
else:
    ans="No"
print(ans)

N = int(input())

f = 0

str_N = str(N)

for i in str_N:
    f += int(i)

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

a=input()
y=[]
for i in range(len(a)):
    y.append(int(a[i]))
if int(a)%sum(y)==0:
    print("Yes")
else:
    print("No")

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

n = int(input())

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

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

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

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

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


N = input()

print('No' if int(N)%sum(map(int, N)) else 'Yes')

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

# coding = SJIS

n = str(input())

a = 0

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

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

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

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

N = int(input())

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

n = int(input())

f = False

x = sum(list(map(int, str(n))))

if n % x == 0:
    f = True

if f:
    print("Yes")
else:
    print("No")

n = input()

def f(x):
    return sum(list(map(int, list(n))))

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

def main():
    N = int(input())
    X = N
    sum = 0
    while True:
        amari = N%10
        sum += amari
        #print(amari,sum)
        N //= 10
        if N == 0:
            break

    if X%sum == 0:
        return 'Yes'
    else:
        return 'No'

print((main()))


A=input()
nu=int(A)
tmp=sum(map(int,list(A)))
print("Yes") if nu%tmp==0 else print("No")

n=int(input())

N=n

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

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

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


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


N=int(input())
f=sum(list(map(int,str(N))))

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

# coding: utf-8

num = input()
table = list(num)
total = 0
for i in range(len(table)):
    total += int(table[i])

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

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


main()

n=int(input())
def digitSum(n):
    # 数値を文字列に変換
    s = str(n)
    # １文字ずつ数値化し配列にする。
    array = list(map(int, s))
    # 合計値を返す
    return sum(array)
print("Yes" if n%digitSum(n)==0 else "No")

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

num = int(input())
num = str(num)
n = list(map(int, num))
S = 0
for i in range(len(n)):
  S += int(n[i])
  
num = int(num)
if num%S==0:
  print('Yes')
else:
  print('No')

N = int(input())


def keta_sum(N):
    if N < 10:
        return N
    else:
        return keta_sum(N // 10) + (N % 10)


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


n = int(input())
m = list(str(n))
f = sum([int(m) for m in m ])

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

#harshad number 
n = int(input()) 
flag = 0 
n_str = str(n) 
n_len = len(n_str) 
n_digit = 0 
for i in range(n_len):
    n_digit += int(n_str[i]) 

if n % n_digit == 0: 
    flag = 1



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


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

n = input()
d = sum(list(map(int, n)))

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

n = input()

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


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

N = int(input())
X = 0
for i in str(N):
    X += int(i)

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


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

n = int(input())

tmp, nx = 0, n
while nx:
    tmp += nx%10
    nx //= 10
    
if n % tmp:
  print("No")
else:
  print("Yes")

S=input()
N=int(S)
f=sum(int(x) for x in S)
if N%f==0:
    print("Yes")
else:
    print("No")


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")

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

import sys

Nstr = sys.stdin.readline().strip()

digit_s = 0
for n_i in Nstr:
    digit_s += int(n_i)

if int(Nstr) % digit_s == 0:
    print("Yes")
else:
    print("No")

n = int(input())
fx = sum(map(int, list(str(n))))
print(['No', 'Yes'][int(n % fx == 0)])

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


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

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

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

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

def digitSum(k):
  if k == 0:
    return 0
  else:
    return digitSum(k//10) + k % 10

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

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

n=int(input())

c=0
for i in str(n):
  c+=int(i)
if n%c==0:
  print("Yes")
else:
  print("No")


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

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

b=input()
f=int(b)
# a=input()
c=[]
# for i in range(b):
#     c.append(a[i])
#a = list(map(int,input().split()))
#b = list(map(int,input().split()))
N = 0
for i in range(len(b)):
    c.append(int(b[i]))
d = f//int(sum(c))
e = f/int(sum(c))

if d==e:
    print("Yes")
else:
    print("No")


n = input()
sum_index = 0
for i in n:
    sum_index += int(i)

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


def d(num):
  l=[int(x) for x in str(num)]
  return sum(l)
  
n = int(input())
print("Yes" if n%d(n)==0 else "No")

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

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

def findSumOfDigits(n):
    sum = 0
    while (n > 0):
        sum += n % 10
        n //= 10
    return sum

ans = 0
n = int(input())
total = findSumOfDigits(n)
if n % total == 0:
    print("Yes")
else:
    print("No")

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

#
# abc080 b
#
import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """12"""
        output = """Yes"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """57"""
        output = """No"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """148"""
        output = """No"""
        self.assertIO(input, output)


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


def __starting_point():
    # unittest.main()
    resolve()

__starting_point()

def digit_sum(num):
    total_num=0
    while num>0:
        total_num+=num % 10
        num//=10
    return total_num

N=int(input())
if N%digit_sum(N)==0 :
  print("Yes")
  return
print("No")

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

N = input()
N_int = int(N)
N_len = len(N)
N_wa = 0
for i in range(N_len):
    N_wa += int(N[i])
if N_int % N_wa == 0:
    print('Yes')
else:
    print('No')


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

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


def is_harshad_number(x: int) -> bool:
    dividend = x
    sum_of_digits = 0

    for _ in range(len(str(x))):
        x, mod = divmod(x, 10)
        sum_of_digits += mod

    return dividend % sum_of_digits == 0


def answer(x: int) -> str:
    return 'Yes' if is_harshad_number(x) else 'No'


def main():
    x = int(input())
    print(answer(x))


def __starting_point():
    main()
__starting_point()


def harshad(n):
    if n % sum(map(int, list(str(n)))) == 0:
        return True
    else:
        return False

N = int(input())
print('Yes' if harshad(N) else 'No')

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


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

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