Let S(n) denote the sum of the digits in the decimal notation of n.
For example, S(101) = 1 + 0 + 1 = 2.
Given an integer N, determine if S(N) divides N.

-----Constraints-----
 - 1 \leq N \leq 10^9

-----Input-----
Input is given from Standard Input in the following format:
N

-----Output-----
If S(N) divides N, print Yes; if it does not, print No.

-----Sample Input-----
12

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

In this input, N=12.
As S(12) = 1 + 2 = 3, S(N) divides N.

Difficulty: introductory

Starter code:

Solutions:
def S(n):
    c = 0
    for i in range(len(n)):
        c += int(n[i])
    return c
 
N = input()
if int(N) % S(N) == 0:
    print('Yes')
else:
    print('No')

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

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

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

n = input()

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

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

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

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

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


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

n = int(input())
k = 0
tmp = n

while tmp > 0:
    k += tmp % 10
    tmp //= 10

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

s = input()
int_s = int(s)

cnt = 0
for i in range(len(s)):
  cnt += int(s[i])

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

N=int(input())

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

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

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

n = input()

sn = 0
for i in n:
    tmp = int(i)
    s = tmp%10
    sn += s

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

import sys

N = input()

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


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

n = int(input())
def sum_digit(x):
    if x < 10:
        return x
    else:
        return x%10 + sum_digit(x//10)

print('No' if n%sum_digit(n) else 'Yes')

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



n=int(input())
s=list(str(n))
for i in range(len(s)):
  s[i]=int(s[i])
b=sum(s)
a=n%b

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

n = int(input())

sum_digits = 0
for c in str(n):
    sum_digits += int(c)

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


n = input()
ans = 0
for i in n:
    ans += int(i)
check = str(int(n) / ans)

if check[-1] == '0':
    print('Yes')
else:
    print('No')

Nlist=list(map(str,input()))
a=0
for i in range(len(Nlist)):
    a+=int(Nlist[i])
N=int(''.join(Nlist))
if N%a==0:
    print('Yes')
else:
    print('No')

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



def __starting_point():
    main()

__starting_point()

# -*- coding: utf-8 -*-
# 標準入力を取得
N = int(input())

# 求解処理


def S(n: int) -> int:
    return sum(map(int, str(n)))


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

# 結果出力
print(ans)


n_1=int(input())
sn=0

n=n_1
while n>0:
    sn+=n%10
    n//=10



if n_1%sn==0:
    print("Yes")
else:
    print("No")


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

N = input()
num = int(N)
Nls = list(N)
sum1 = sum([int(i) for i in Nls])
if num%sum1 == 0:
  print('Yes')
else:
  print('No')

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

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

n=int(input())
ns="{:010d}".format(n)
ns=str(ns)
sum=0
for i in range(10):
    sum+=int(ns[i])
if n%sum==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')

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


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

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

N = input()
Sn = 0

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

N = int(input())
M = N
sum = 0
while True:
  if N == 0:
    break
  sum += N%10
  N = (N//10)
print('Yes' if M % sum == 0 else 'No')

N = int(input())
def S(n):
    s = str(n)
    v = 0
    for i in range(len(s)):
        v += int(s[i])
    return v
print('Yes' if N % S(N) == 0 else 'No')

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

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

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

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

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

s = input()
n = int(s)
m = list(s)
l = [int(i) for i in m]
su = sum(l)
if n % su == 0:
    print('Yes')
else:
    print('No')

n = int(input())
x = n
sum = 0
while x:
    sum += (x % 10)
    x //= 10
if(n % sum == 0):
    print("Yes")
else:
    print("No")


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

N = input()

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

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

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

nlist = list(map(int,input()))
rev_n = list(reversed(nlist))
sn = sum(nlist)
n = 0

for i in range(len(nlist)):
    n += rev_n[i]*(10**i) 
if n%sn == 0:
    print("Yes")
else:
    print("No")

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

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

n = int(input())
s = sum(map(int, list(str(n))))

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


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

def S(n):
    c = 0
    for i in range(len(n)):
        c += int(n[i])
    return c

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


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

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

N = int(input())

def S(n):
   result = 0
   for i in range(len(str(n))):
      result += int(str(n)[i])
   return result

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

n = input()
sn = sum([int(n[i]) for i in range(len(n)) ])
n = int(n)

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


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

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

N=int(input())
S=sum(map(int,list(str(N))))
if N%S==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])
if int(n)%s == 0:
    print('Yes')
else:
    print('No')

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N = S()
    ans = 0
    for c in N:
        ans += int(c)
    if int(N) % ans == 0:
        print("Yes")
    else:
        print("No")


main()



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


main()

# -*- coding: utf-8 -*-

def get_input() -> int:
    """
    標準入力を取得する.

    Returns:\n
        int: 標準入力
    """
    N = int(input())

    return N


def S(n: int) -> int:
    """
    各桁の和を取得する.

    Args:\n
        n (int): 整数

    Returns:\n
        int: 各桁の和
    """
    return sum(map(int, str(n)))


def main(N: int) -> None:
    """
    メイン処理.

    Args:\n
        N (int): 整数(1 <= N <= 10**9)
    """
    # 求解処理
    ans = str()
    if N % S(N) == 0:
        ans = "Yes"
    else:
        ans = "No"

    # 結果出力
    print(ans)


def __starting_point():
    # 標準入力を取得
    N = get_input()

    # メイン処理
    main(N)

__starting_point()

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


li = list(map(int, input()))
N=0
for i in range(len(li)):
  N=N+li[len(li)-1-i]*10**i
S=sum(li)
if N%S==0:
  print('Yes')
else:
  print('No')

a=input()
sum=0
for i in a:
    sum=sum+ord(i)-48

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

def sum_digit(n):
    temp = 0
    while n > 0:
        temp += n % 10
        n //= 10
    return temp


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


#!/usr/bin/env python3
import sys
def input(): return sys.stdin.readline().rstrip()


def main():
    S = input()
    ans = 'Yes' if int(S) % sum(map(int, list(S))) == 0 else 'No'
    print(ans)


def __starting_point():
    main()

__starting_point()

n = int(input())
 
def check(p):
  c = 0
  while p > 0:
    c += p % 10
    p //= 10
  return c
 
if n % check(n) == 0:
  print("Yes")
else:
  print("No")

n=int(input())
n_=n
sn=0
while n_!=0:
    sn+=n_%10
    n_=n_//10
if n%sn==0:
    print('Yes') 
else:
    print('No')    

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


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

N = int(input())

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

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

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

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

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

n=int(input())
nl=list(str(n))
l=len(nl)


sn=0

for i in range(l):
    sn += int(nl[i])

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

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


def answer(n: int) -> str:
    temp = n
    sum_of_digits = 0

    while 0 < temp:
        temp, mod = divmod(temp, 10)
        sum_of_digits += mod

    return 'Yes' if n % sum_of_digits == 0 else 'No'


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


def __starting_point():
    main()
__starting_point()

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

def s(n):
  res = 0
  while n > 0:
    res += n % 10
    n //= 10
  return res

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

import sys
input = sys.stdin.readline

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

n = int(input())
a = list(str(n))
b = 0
for i in a:
    b += int(i)
if n % b == 0:
    print('Yes')
else:
    print('No')

#!/usr/bin/env python3
# code
N = input()
N_NUMBER = int(N)
N_SUM = sum([int(i) for i in N])

if (N_NUMBER % N_SUM) == 0:
    print('Yes')
else:
    print('No')


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

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

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


a = int(input())
b = sum(list(map(int,list(str(a)))))
ans = a%b
print("Yes" if ans == 0 else"No")

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

n = int(input())
s = sum(list(map(int, list(str(n)))))

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

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

import sys
lines = [s.rstrip("\n") for s in sys.stdin.readlines()]
n, = [int(num) for num in lines.pop(0).split(" ")]
s = sum(int(c) for c in str(n))
if n % s == 0:
    print("Yes")
else:
    print("No")


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

N_string = input()
N = int(N_string)
sum = 0
for n in N_string:
  sum = sum + int(n)
if N % sum == 0:
  print('Yes')
else:
  print('No')

num=input()
num1=num
j=0
while int(num)>0:
  j+=int(num)%10
  num = int(num)/10
if int(num1)%j==0:
  print("Yes")
else:
  print("No")

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

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

n=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()
l = len(n)

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