peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
if __name__ == '__main__':
    a = [int(i) for i in input().split()]
    diff = a[1]-a[0]
    count =0
    for i in range(diff):
        count+=i

    print(count-a[0])
# Judge status: Accepted
import sys
N,M=map(int,input().split())
A=[]
for i in range(N):
  a=input()
  A.append(a)
B=[]
for j in range(M):
  b=input()
  B.append(b)
for k in range(N-M+1):
  for l in range(N-M+1):
    z=0
    for m in range(M):
      try:
        if B[m]==A[k+m][l:l+M]:
          z+=1
      except:
        sys.stderr.write(f"{k,l,m}")
        pass
    if z==M:
      print("Yes")
      sys.exit()
print("No")
# Judge status: Accepted
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    R=I()
    print(2*R*3.1415926535)

main()
# Judge status: Accepted
N=int(input())
S=list(input())
d=1
for i in range(N//2):
  if S[i]!=S[i+N//2]:
    d=0
print('Yes' if d==1 and N!=1 and (N%2)==0 else 'No')
# Judge status: Accepted
N = int(input())
rate = [1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
p = [0] * 9

A = [int(a) for a in input().split(" ")]
A.sort()

j = 0
for i in range(len(A)):
  while j < 8:
    if rate[j] <= A[i] < rate[j + 1]:
      p[j] = 1
      break
    else:
      j += 1
  else:
    p[8] = len(A[i:])
    break

print(str(max([sum(p[:8]), 1])) + " " + str(sum(p)))
# Judge status: Wrong Answer
n, k = map(int, input().split())

ans = 0

for i in range(k, n+2):
    ans += int((i * (2 * n - i + 1) / 2) - (i * (i - 1) / 2) + 1)
print(ans)
# Judge status: Accepted
import sys
A,B = map(int,input().split())
if not ( 10000 <= A <= B <= 99999 ):
    sys.exit()

count = 0
for I in range(A,B+1):
    if str(I) == str(I)[::-1]:
        count += 1
print(count)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
ans = sum(B)
for i in range(N-1):
    if A[i]+1 == A[i+1]:
        ans += C[A[i]-1]
print(ans)
# Judge status: Accepted
A = input()
B = input()
a_list = ['1', '2', '3']
a_list.remove(A)
a_list.remove(B)
print(a_list[0])
# Judge status: Accepted
n = int(input())
ans = list(input())
for i in range(n-1):
    s = list(input())
    t = []
    for j in ans:
        if j in s:
            s.remove(j)
            t.append(j)
    ans = t
ans.sort()
print("".join(ans))
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
#n = int(input())
#l = list(map(int, input().split()))
'''
A=[]
B=[]
for i in range():
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)'''
import math
ab=input().split()
a=int(ab[0])
b=int(float(ab[1])*100)
#print(b)
print(a*b//100)
# Judge status: Accepted
n = int(input())

ans=set()
for i in range(1,3 * int(n ** 0.5)):
    n -= i
    ans.add(i)
    if n < i + 1:
        ans.add(i + 1)
        no = i + 1 - n
        break

for i in ans:
    if i == no:
        continue
    print(i)
# Judge status: Wrong Answer
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

s = s()

a = set(s)
if len(a)%2 == 0:
	print("Yes")
elif len(a)%2 != 0:
	print("No")
# Judge status: Accepted
N = int(input())
a = list(map(int,input().split()))
a4 = [i for i in a if i%4 == 0]
a2 = [i for i in a if i%2 == 0]
num4 = len(a4)
num2 = len(a2) - num4
num1 = N-num2-num4
if num2 == 0 and num4 == num1-1:
    print('Yes')
elif num1 > num4:
    print('No')
else:
    print('Yes')
# Judge status: Accepted
import numpy as np
 
N,M = map(int,input().split())
A = np.array([list(input()) for _ in range(N)])
B = np.array([list(input()) for _ in range(M)])
 
bl = False
for i in range(N-M+1):
  for j in range(N-M+1):
    if (A[i:i+M,j:j+M] == B).all():
      bl = True
 
answer = 'Yes' if bl else 'No'
print(answer)
# Judge status: Accepted
# coding: utf-8
sx, sy, tx, ty = map(int, input().split())

ans = ""
dx = tx - sx
dy = ty - sy

for i in range(dx):
    ans += "R"
for i in range(dy):
    ans += "U"
for i in range(dx):
    ans += "L"
for i in range(dy + 1):
    ans += "D"
for i in range(dx + 1):
    ans += "R"
for i in range(dy + 1):
    ans += "U"
ans += "LU"
for i in range(dx + 1):
    ans += "L"
for i in range(dy + 1):
    ans += "D"
ans += "R"

print(ans)
# UURDDLLUUURRDRDDDLLU
# Judge status: Wrong Answer
l = sorted(map(int, input().split()))
if l == [5, 5, 7]:
  ans = 'Yes'
else:
  ans = 'No'
print(ans)
# Judge status: Accepted
# n = int(sys.stdin.readline())
import sys,bisect,math
sys.setrecursionlimit(15000)

s = sys.stdin.readline().rstrip()
cum = [0]*(len(s)+1)#cumulative sum
import collections
d = collections.defaultdict(int)
d[0] = 1
ret = 0
dig = 1
for i in range(len(s))[::-1]:
    cum[i]=(int(s[i])*dig+cum[i+1])%2019
    dig = (dig*10)%2019
    #cum[i+1]=int(s[i:])%2019
    if cum[i] in d:
        ret += d[cum[i]]
    d[cum[i]] += 1
#print(d,cum,ret)
print(ret)
# Judge status: Wrong Answer
def main():
    N, K = map(int, input().split())
    ins_num = [0 for i in range(10**5 + 1)]

    for i in range(N):
        a, b = map(int, input().split())
        ins_num[a] += b

    ins_count = 0

    for i in range(1, N + 1):
        if ins_count + ins_num[i] >= K:
            print(i)
        else:
            ins_count += ins_num[i]

if __name__ == "__main__":
    main()
# Judge status: Accepted
# coding: utf-8
# Your code here!




def insert_str(target, i, char):
    return target[:i] + char + target[i:]

def calc(target, i):
    global ans
    
    if ans != "":
        return
    
    if i == 7:
        if eval(target) == 7:
            ans = target+"=7"
            return ans
        return
    calc(insert_str(target, i, "+"), i+2)
    calc(insert_str(target, i, "-"), i+2)
        
S = input()
N = len(S)
ans = ""
calc(S, 1)


print(ans)
# Judge status: Accepted
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

for i in range(0, 3):
    for j in range(i, 3):
        if a[i] + b[j] != a[j] + b[i] or a[i] + c[j] != a[j] + c[i] or b[i] + c[j] != b[j] + c[i]:
            print("No")
            quit(0)

print("Yes")
# Judge status: Accepted
n,m=map(int,input().split())
for i in range(m):
    print(i+1,n-i-((i>=m/2)&~n))
# Judge status: Accepted
n, l = map(int, input().split())
s = []
for _ in range(n):
    s.append(input())
s = sorted(s)
print(''.join(s))
# Judge status: Wrong Answer
S = input()
N = len(S)
s = S[::-1]

if S != s:
    print('No')
    exit()

if (S[:(N-1)//2]) != (s[:((N-1)//2)]):
    print('No')
    exit()

if S[((N+3)//2)-1:] != s[((N+3)//2)-1:]:
    print('No')
    exit()

print('Yes')
# Judge status: Wrong Answer
a, b = map(int, input().split())

if a + b> 24:
    print(a + b - 24)
else:
    print(a + b)
# Judge status: Accepted
a,b,c = map(int, input().split())
if a<b:
    if a<c and c<b:
        print("Yes")
    else:
        print("No")
else:
    if a>c and c>b:
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
import math  # noqa
import bisect  # noqa
import queue  # noqa


if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))

    cnt_neg = 0
    abs_min = 1000000005
    for a in A:
        abs_min = min(abs_min, abs(a))
        if a < 0:
            cnt_neg += 1

    ans = 0
    for a in A:
        ans += abs(a)

    if cnt_neg % 2 != 0:
        ans -= 2 * abs_min

    print(ans)
# Judge status: Wrong Answer
A, B, N = [int(x) for x in input().split()]
max_val = 0
i = B-1
for j in range(min(i,N)):
  x = (A*j)//B - A*(j//B)
  if x > max_val:
    max_val = x

while i<=N:
  x = (A*i)//B - A*(i//B)
  if x > max_val:
    max_val = x
  i+=B
print(max_val)
# Judge status: Accepted
#!/usr/bin/python3
# -*- coding:utf-8 -*-

from math import log, floor

def main():
  n = int(input())
  min = 10**10
  for i in range(n+1):
    cc = 0
    t = i
    while t > 0:
      cc += (t%6)
      t//=6
    t = n - i
    while t > 0:
      cc += (t%9)
      t//=9
    if min > cc:
      min = cc
  print(min)

if __name__=='__main__':
  main()
# Judge status: Wrong Answer
from collections import Counter

S = input()
T = input()

s = list(Counter(S).values())
t = list(Counter(T).values())
if len(s) != len(t) or s != t:
    print("No")
else:
    print("Yes")
# Judge status: Accepted
n = int(input())
c = [0] * (n-1)
s = [0] * (n-1)
f = [0] * (n-1)
ans = [0] * n
for i in range(n-1):
    c[i],s[i],f[i] = map(int, input().split())
for i in range(n-1):
    for j in range(i,n-1):
        s2 = s[j]

        while s2 < ans[i]:
            s2 += f[j]
        ans[i] = c[j] + s2
#print(ans)
for i in range(n):
    print(ans[i])
# Judge status: Accepted
S = input()
S = S.replace('eraser','')
S = S.replace('erase','')
S = S.replace('dreamer','')
S = S.replace('dream','')

if S == '':
    print('YES')
else:print('NO')
# Judge status: Accepted
N = input()
S = input()
s = S
for i in range(50):
  S = S.replace('()','')
l = S.count(')')
r = S.count('(')
print('('*l+s+')'*r)
# Judge status: Wrong Answer
def main():
    from sys import stdin, setrecursionlimit
    setrecursionlimit(10**6)
    r = stdin.readline()[:-1]
    #n = int(stdin.readline()[:-1])   
    #r = [stdin.readline() for i in range(n)]
    #t = [int(stdin.readline()) for i in range(n)]

    res = 0
    a, b = map(int, r.split())
    print(min(a,b))

if __name__ == '__main__':
    main()
# Judge status: Accepted
#!/usr/bin/env python3

N = int(input())
A = list(map(int, input().split()))

guusuu = []
kisuu = []

for i in range(N):
    if i % 2 == 0:
        guusuu.append(A[i])
    else:
        kisuu.append(A[i])

ret = []
if N % 2 == 0:
    ret = kisuu[::-1] + guusuu
else:
    ret = guusuu[::-1] + kisuu

print(' '.join(map(str, ret)))
# Judge status: Accepted
n = int(input())
d = sorted(list(map(int, input().split())))
l = len(d)

abc = d[:l//2]
arc = d[l//2:]

if abc[-1] == arc[0]:
    print(0)
    exit()
    
print(arc[0] - abc[-1])
# Judge status: Accepted
S = list(input())
T = list(input())
cmin = 1000

for i in range(len(S)-len(T)+1):
    c = 0
    s = S[i:i+len(T)]
    for j in range(len(T)):
        if s[j] != T[j]:
            c += 1
    cmin = min(c,cmin)

print(cmin)
# Judge status: Accepted
import sys
n, c, k = map(int, input().split())
a = list(map(int, sys.stdin.readlines()))+[10**10]
a.sort()
ans, cnt, tmp = 0, 1, a[0]+k
for i in a[1:]:
    if i <= tmp and cnt < c:
        cnt += 1
    else:
        tmp, cnt = i + k, 1
        ans += 1

print(ans)
# Judge status: Accepted
N = int(input())
A = [int(x) for x in input().split()]
B = list(set(A))
if(len(A)==len(B)):
  print('YES')
else:
  print('NO')
# Judge status: Accepted
N = int(input())
S = input()
cnt = S[1:].count("E")
ans = cnt
for i in range(1,N):
    if S[i-1] == "W":
        cnt += 1
    if S[i] == "E":
        cnt -= 1
    ans = min(ans,cnt)
print(ans)
# Judge status: Accepted
def main():
    a, b = map(int, input().split())
    n = (b - a) - 1
    a_ = n*(n+1)/2
    print(int(a_ - a))
main()
# Judge status: Accepted
import math
n, k = map(int, input().split())
A = input()

print(math.ceil((n-1) / (k-1)))
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    N = int(input())
    A = map(int, input().split())
    A = sorted([a - i - 1 for i, a in enumerate(A)])

    b = A[N//2]
    print(sum([abs(a - b) for a in A]))

if __name__ == '__main__':
    main()
# Judge status: Accepted
import fractions
a,b = map(int,input().split())
d = fractions.gcd(a,b)
print(d*(a//d)*(b//d))
# Judge status: Accepted
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
s = S()
if s == 'SUN':
    print(7)
elif s == 'MON':
    print(6)
elif s == 'TUE':
    print(5)
elif s == 'WED':
    print(4)
elif s == 'THU':
    print(3)
elif s == 'FRI':
    print(2)
elif s == 'SAT':
    print(1)
# Judge status: Wrong Answer
alpha="abcdefghijklmnopqrstuvwxyz"
s=input()
s1=set(s)
s2=sorted(list(s1))
for i in range(len(alpha)):
    if i==len(s2):
        print(chr(ord(s[i-1])+1))
        exit()

    if s2[i]!=alpha[i]:
        print(alpha[i])
        exit()
print("None")
# Judge status: Accepted
n,k = map(int,input().split())
P = list(map(int,input().split()))
ans = 0
for i in range(k):
    m = min(P)
    ans += m
    P.remove(m)
print(ans)
# Judge status: Wrong Answer
x,y,z=map(int,input().split())
print((x-z)//y)
# Judge status: Accepted
#
# Written by NoKnowledgeGG @YlePhan
# ('ω')
#
#import math
#mod = 10**9+7
#import itertools
#import fractions
#import numpy as np
#mod = 10**4 + 7
"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""
 
def main():
  a,b,k = map(int,input().split())
  k -= 1 # indexed
  ANS = []
  if a > b:
    a,b = b,a
  for i in range(1,a+1):
    if a%i == 0 and b%i == 0:
      ANS.append(i)
  ANS = sorted(ANS,reverse=True)
  print(ANS[k])
if __name__ == '__main__':
  main()
# Judge status: Accepted
n = int(input())
s = input()

key = [0]*(n+1)
for i in range(n):
  key[i+1] = key[i]
  if s[i] == "#":
    key[i+1] += 1

ans = n+1
for i in range(n+1):
  sub = 2*key[i]+n-i-key[-1]
  if ans > sub:
    ans = sub

print(ans)
# Judge status: Accepted
n = int(input())

for i in range(n + 1):
    if (i + 1) ** 2 > n:
        break
print(i ** 2)
# Judge status: Wrong Answer
N, M = map(int, input().split())
SC = [[int(x) for x in input().split()] for _ in range(M)]

ans = [0] * N
flg = 0

for s, c in SC:
    if (flg>>(s-1))&1:
        ans[s-1] = min(ans[s-1], c)
    else:
        flg |= 1<<(s-1)
        ans[s-1] = c


ans = ''.join(map(str, ans))
ans = str(int(ans))

if len(ans)!=N:
    print(-1)
else:
    print(ans)
# Judge status: Accepted
N = int(input())
A = sorted(list(map(int,input().split())))
lim = max(A)
B = [0] * (lim+1)
for i in range(N):
    B[A[i]] += 1
ans = N
for i in range(1,lim+1):
    if B[i] == 0:
        continue
    if B[i] >= 2:
        ans -= B[i]
        B[i] = 0
    for j in range(i*2,lim+1,i):
        ans -= B[j]
        B[j] = 0

print(ans)
# Judge status: Accepted
wl = list(input())
for w in wl:
    if wl.count(w) % 2 != 0:
        print('No')
        exit()
else:
    print('Yes')
# Judge status: Wrong Answer
n,x=map(int,input().split())
a=list(map(int,input().split()))
dp=[0]*(n-1)
ans=0
for i in range(n-1):
  dp[i]=a[i]+a[i+1]
for j in range(n-2):
  if dp[j]>x:
    dp[j+1]-=dp[j]-x
    ans+=dp[j]-x
if dp[n-2]>x:
  ans+=dp[n-2]-x
print(ans)
# Judge status: Accepted
import numpy as np
 
h, n = map(int, input().split())
a = []
b = []
for _ in range(n):
  ai, bi = map(int, input().split())
  a.append(ai)
  b.append(bi)
a = np.array(a)
b = np.array(b)
dp = np.zeros(h+1, dtype=np.int)
for c in range(1, h+1):
  dp[c] = np.min(dp[np.maximum(0, c-a)] + b)
print(dp[-1])
# Judge status: Wrong Answer
s = input()
ans = ""
for k in s:
  if k == 'B':
    if len(s) > 0:
      ans = ans[:len(s)-1]
  else:
    ans += k
print(ans)
# Judge status: Accepted
n = int(input())
p = list(map(int, input().split()))

start = 2 - 1
end = len(p) - 1

count = 0
for i in range(start, end):
    
    a = p[i - 1]
    b = p[i]
    c = p[i + 1]
    
    # print(f'{p[i - 1]} {p[i]} {p[i + 1]}')
    
    new_list = sorted([a, b, c])
    
    if b == new_list[1]:
        # print(f'{a} {b} {c}')
        count += 1
        
print(count)
# Judge status: Accepted
N, M = map(int, input().split())
A = [input() for _ in range(N)]
B = [input() for _ in range(M)]
ans = False

for i in range(N-M+1):
  for j in range(N-M+1):
    flg = True
    for k in range(M):
      if A[i+k][j:j+M] != B[k]:
        flg = False
    if flg:
      ans = True

if ans:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
n=int(input())
l=[list(map(int,input().split())) for i in range(n-1)]

for i in range(n-1):
  t=l[i][1]
  t+=l[i][0]
  for j in range(i+1,n-1):
    if t<l[j][1]:
      t=l[j][1]
    elif t%l[j][2]!=0:
      t+=t%l[j][2]
    t+=l[j][0]

  print(t)
print(0)
# Judge status: Wrong Answer
n,h=map(int,input().split())
A=[]
B=[]
for i in range(n):
  a,b=map(int,input().split())
  A.append(a)
  B.append(b)
A=max(A)
B.sort(reverse=True)
count=0
for i in B:
  if A>i:
    break
  else:
    h-=i
    count+=1
print(count+h//A)
# Judge status: Accepted
n,x = map(int,input().split())

a = list(map(int,input().split()))

a.sort()

sweets=0

ans = 0

for i in range(n):
    sweets += a[i]
    if sweets <= x:
        ans += 1
    else:
        break

if sweets < x:
    print(ans-1)
else:
    print(ans)
# Judge status: Accepted
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))

_h = []
#t - 0.006*x

for i in range(n):
    _h.append(abs(t - 0.006*h[i] - a))

print(_h.index(min(_h)) + 1)
# Judge status: Accepted
p = list(map(int, input().split()))
n = int(input())

l = [min(p[0] * 4, p[1] * 2, p[0] * 2 + p[1], p[2]), p[3]]
ppl = [l[0], l[1] / 2]

if (ppl[0] <= ppl[1]):
    print(n * l[0])
else:
    print((n//2)*l[1] + (n % 2) * l[0])
# Judge status: Accepted
N, D = map(int, input().split())
if N % (2 * D + 1) == 0:
    print(N // (2 * D + 1))
else:
    print(N // (2 * D + 1) + 1)
# Judge status: Accepted
import sys
input = lambda: sys.stdin.readline().rstrip()

MOD = 1000000007

X,Y = map(int, input().split())

if (X+Y) % 3 != 0:
    print(0)
    exit()

def combination(n,r,mod):
    r = min(r, n-r)
    numer = denom = 1

    for i in range(r):
        numer = numer*(n-i)%mod
        denom = denom*(i+1)%mod
    return numer * pow(denom, mod-2, mod) % mod


tmp = (X+Y) // 3
m = X - tmp
n = Y - tmp
if m < 0 or n < 0:
    print(0)
    exit() 

ans = combination(m+n, m, MOD)
print(ans)
# Judge status: Accepted
s = {'a': input(), 'b': input(), 'c': input()}
 
now = 'a'
while s[now] != '':
    next = s[now][0]
    s[now] = s[now][1:]
    now = next
print(now.upper())
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().rstrip()
import numpy as np
def main():
    h,n=map(int,input().split())
    lis=np.array([list(map(int,input().split())) for _ in range(n)])
    a_max=np.max(lis[:,0])
    dp=np.zeros(h+a_max+1,int)
    for i in range(a_max+1,a_max+h+1):
        dp[i]=np.min(dp[i-lis[:,0]]+lis[:,1])
    print(dp[a_max+h])

if __name__=='__main__':
    main()
# Judge status: Wrong Answer
N = int(input())
p = list(map(int, input().split()))

ans = 0
for i in range(N):
    if p[i] == i+1:
        ans += 1

print(ans)
# Judge status: Accepted
s=input()
s=s.replace('eraser','')
s=s.replace('erase','')
s=s.replace('dreamer','')
s=s.replace('dream','')
 
if s:
    print("NO")
else:
    print("YES")
# Judge status: Accepted
N = int(input())

alphabets = 'abcdefghijklmnopqrstuvwxyz'

def dfs(s, max_idx):
  if len(s) == N:
    print(s)
    return
  else:
    for i in range(0, max_idx+2, 1):
      t = s
      t = t + alphabets[i]
      dfs(t, max(i, max_idx))
    
dfs("", -1)
# Judge status: Accepted
import math


a, b = map(int, input().split())

def actual(a, b):
    return math.ceil((b - 1) / (a - 1))

print(actual(a, b))
# Judge status: Accepted
from functools import reduce
import fractions

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

N = int(input())
A = list(map(int,input().split()))
B = 0
div = 10**9+7

lcm_A = lcm_list(A)

for item in A:
    B+=(lcm_A//item)

print(B%div)
# Judge status: Accepted
N, K = map(int, input().split())
A = list(map(int, input().split()))
l = [0 for _ in range(N)]

now = 0
l[now] = 1
count = 0
loop = [0]

while count < K:
    count += 1
    now = A[now]-1
    loop.append(now)
    if l[now] == 1:
        loop = loop[loop.index(now):-1]
        break
    else:
        l[now] = 1

if count == K:
    print(now + 1)
else:
    ans = loop[(K-count) % len(loop)]
    print(ans + 1)
# Judge status: Wrong Answer
from math import floor
from decimal import Decimal

A, B = list(map(int, input().split()))

num = A
c = 0
while num < B:
    num *= 2
    c+=1

print(c)
# Judge status: Accepted
# C - 4-adjacent
_ = input()
count1 = count4 = 0
not_exist2 = 1
for a in map(lambda x: int(x)%4, input().split()):
    if a==0: count4 += 1
    elif a==2: not_exist2 = 0
    else: count1 += 1
print("Yes" if count1 <= count4 + not_exist2 else "No")
# Judge status: Accepted
# Problem B - Comparing Strings

# input
a, b = map(int, input().split())

# initialization
a_str = str(a) * b
b_str = str(b) * a

# output
if a_str<=b_str:
    print(a_str)
else:
    print(b_str)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

set_A = set(A)

if len(A) == len(set_A):
  print('YES')
else:
  print('NO')
# Judge status: Accepted
a, b, c = sorted(map(int, input().split()))
print(c*10+b+a)
# Judge status: Accepted
N,K = map(int,input().split())
S = input()

score = 0

for i in range(1,N):
  if S[i] == S[i - 1]:
    score += 1
    
ans = min(score + 2 * K,N - 1)

print(ans)
# Judge status: Wrong Answer
n = int(input())

t = 0
    
while t*111 < n < (t+1)*111:
    t += 1
    
print(t*111)
# Judge status: Accepted
import bisect
N=int(input())
A=[int(input()) for _ in range(N)]
color=[]
A=A[::-1]
for a in A:
    i=bisect.bisect_right(color,a)
    if i==len(color):
        color.append(a)
    else:
        color[i]=a
print(len(color))
# Judge status: Accepted
X ,Y = map(int,input().split())
if X > 50:
    print('No')
    exit(0)
for i in range(1, X+1):
    f = 2 * i + 4 * (X - i)
    if f == Y:
        print('Yes')
        break
else:
    ans = X * 4
    count = ans/4
    if count == X and ans==Y and Y%4 == 0:
        print('Yes')
    else:
        print('No')
# Judge status: Accepted
N, K = map(int, input().split())
A = [0] * N
for i in range(N):
  A[i] = list(map(int, input().split()))
  
A = sorted(A)
now = 0
for i in range(N):
  if now + A[i][1] >= K:
    print(A[i][0])
    quit()
  else:
    now += A[i][1]
# Judge status: Wrong Answer
X = int(input())
N = X // 100
for n in range(N):
  M = X - n * 100
  if M > n * 5:
    continue
  else:
    print(1)
    break
else:
  print(0)
# Judge status: Accepted
from fractions import gcd

def factorization(n):
    res = []
    m = 2
    while m ** 2 <= n:
        if n % m == 0:
            cnt = 0
            while n % m == 0:
                cnt += 1
                n //= m
            res.append([m, cnt])
        m += 1

    if n > 1:
        res.append([n, 1])

    return res


a, b = map(int, input().split())
print(len(factorization(gcd(a, b))) + 1)
# Judge status: Accepted
import bisect

N = int(input())
L = list(map(int, input().split()))
L.sort()

ans = 0

for i in range(N - 1, 1, -1):
    for j in range(i - 1, 0, -1):
        x = bisect.bisect(L, L[i] - L[j])
        ans += max((j - x), 0)

print(ans)
# Judge status: Accepted
N = int(input())
csf = [list(map(int, input().split())) for _ in range(N-1)]

for i in range(N-1):
    t = csf[i][1]
    t += csf[i][0]
    for j in range(i+1, N-1):
        st = csf[j][1]
        f = csf[j][2]
        t = max(st, ((t-1)//f+1)*f)
        t += csf[j][0]

    print(t)
print(0)
# Judge status: Accepted
A,B,C,K = map(int,input().split())

if K%2 == 0:
    ans = A - B 
else:
    ans = B - A
print(ans)
# Judge status: Accepted
N = int(input()) 
ans=""
while N>0:
    N -= 1
    ans += chr(ord('a') + N % 26) 
    N //= 26
print(ans[::-1])
# Judge status: Wrong Answer
n, m = map(int, input().split())
max_l = 1
min_r = n 

for _ in range(m):
    l, r = map(int, input().split())
    max_l = max(max_l, l)
    min_r = min(min_r, r)

ans = min_r - max_l + 1
print(ans)
# Judge status: Accepted
def main():
    s = input()
    t = input()

    ds, dt = {}, {}
    for cs, ct in zip(s, t):
        if (ds.get(cs) is not None and ds.get(cs) != ct) \
                or (dt.get(ct) is not None and dt.get(ct) != cs):
            print('No')
            exit()

        ds[cs] = ct
        dt[ct] = cs

    print('Yes')

if __name__ == "__main__":
    main()