peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import fractions
a, b, c, d = list(map(int, input().split()))
ans = []
for n in [a - 1, b]:
    mc = n // c
    md = n // d
    cd = c * d // fractions.gcd(c, d)
    mcd = n // cd
    ans.append(n - mc - md + mcd)
print(int(ans[1] - ans[0]))
# Judge status: Accepted
#ABC110C
import sys
s=input();t=input()
start=[-1]*26
goal=[-1]*26
for i in range(len(s)):
    a=int(ord(s[i])-97)
    b=int(ord(t[i])-97)
    if start[a]!=-1 or goal[b]!=-1:
        if start[a]!=b or goal[b]!=a:
            print("No")
            sys.exit()
    else:
        start[a]=b
        goal[b]=a
print("Yes")
# Judge status: Wrong Answer
K, X = map(int, input().split())

if X >= 500 * K:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
li = list(input())
ans = ''

for i in li:
    if i == '0':
        ans += '0'
    elif i == '1':
        ans += '1'
    else:
        ans = ans[0:-1]

print(ans)
# Judge status: Wrong Answer
s=input()
s1=int(s[0]+s[1])
s2=int(s[2]+s[3])
ans=""
if s1>12:
	if s2>12:
		ans="NA"
	else:
		ans="YYMM"
else:
	if s2>12:
		ans="MMYY"
	else:
		ans="AMBIGUOUS"
print(ans)
# Judge status: Wrong Answer
A,B,C = map(int, input().split())

sum=A
while sum % B != 0:
    sum = sum + A

    if sum%B==C:
        print("Yes")
        break
else:
    print("No")
# Judge status: Accepted
N = int(input())

for a in range(N//4+1):
    for b in range(N//7+1):
        if 4*a + 7*b == N:
            print('Yes')
            exit()
print('No')
# Judge status: Wrong Answer
N = input()
if int(N) % 2 == 0:
  print(int(N) / 2)
else:
  print(int(N) / 2 + 0.5)
# Judge status: Accepted
input()
l = list(map(int, input().split()))
count = 0
while True:
  t = list(filter(lambda x:x % 2 != 0, l))
  if len(t) > 0:
    break
  l = list(map(lambda x:x/2, l))

  count += 1

print(count)
# Judge status: Wrong Answer
x = int(input())
for i in range(x,x+1000):
  if all([i%j!=0 for j in range(2,1000)]):
    print(i)
    break
# Judge status: Accepted
n=int(input())
f=0
while n>0:
      c=n%10
      if  c==7:
            f=1
            print("Yes")
            break
      n=int(n/10)
if f==0:
      print("No")
# Judge status: Accepted
N,M=map(int,input().split())
d={}
PY=[]
import bisect
for _ in range(M):
    p,y=map(int,input().split())
    PY.append((p,y))
    t=d.get(p, [0])
    i=bisect.bisect_left(t,y)
    t.insert(i,y)
    d[p]=t
    
dx={}
for k, v in d.items():
    for i in range(len(v)):
        dx[(k,v[i])]=i
        
for p,y in PY:
    print(str(p).zfill(6)+str(dx[(p,y)]).zfill(6))
# Judge status: Accepted
n = int(input())
a = (n-1)//1000
print((a+1)*1000-n)
# Judge status: Accepted
S,W = map(int,input().split())
if W >= S:
    print('unsafe')
else:
    print('safe')
# Judge status: Wrong Answer
from fractions import gcd

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

print('YES' if gcd(A, B) % C == 0 else 'NO')
# Judge status: Accepted
a, b, x = map(float, input().split())

import math

box_volume = float(a**2*b)
if x >= 0.5*box_volume:
    sita = math.degrees(math.atan(2*(box_volume-x)/a**3))
else:
    sita = 90 - math.degrees(math.atan(2*x/(a*b**2)))
    
print(sita)
# Judge status: Wrong Answer
S = list(input())

left = [S.pop(0)]
ans = 0
if not S:
    print(ans)

i = 0
while i < len(S):
    if not left:
        left.append(S[i])
        i += 1
    else:
        if left[-1] + S[i] in ['01', '10']:
            left.pop()
            ans += 1
            i += 1
        else:
            left.append(S[i])
            i += 1
print(2*ans)
# Judge status: Accepted
N, A, B = map(int, input().split())
diff = B - A
if diff % 2 == 0:
    print(diff//2)
else:
    tmp1 = (B - A + 1) // 2
    tmp1 = B - tmp1
    tmp2 = (2 * N - B + A + 1) // 2 
    tmp2 = tmp2 - A
    print(min(N-A, B-1, tmp1, tmp2))
# Judge status: Accepted
S = input()
T = input()
p = list(S)
q = list(T)
cnt = 0
for i in range(len(p)):
    if p[i] != q[i]:
        cnt += 1
print(cnt)
# Judge status: Wrong Answer
def ABC_70_B():
    A,B,C,D = map(int, input().split())

    if A<=C and B>=D:
        print(D-C)
    elif A<=C and B<=D:
        print(B-C)
    elif A>=C and B>=D:
        print(B-A)
    elif B>=C and A<=C:
        print(B-C)
    else:
        print(0)

if __name__ == '__main__':

    ABC_70_B()
# Judge status: Accepted
import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
A = np.zeros(N+2, np.int32)
A[1:-1] = np.array([ir() for _ in range(N)])

left_max = np.maximum.accumulate(A[:-2])
right_max = np.maximum.accumulate(A[::-1])[::-1][2:]
answer = np.maximum(left_max, right_max)
print('\n'.join(map(str, answer)))
# Judge status: Accepted
N = int(input())

L = [2, 1]

for c in range(85):
    Lc = L[-1] + L[-2]
    L.append(Lc)

print(L[N])
# Judge status: Wrong Answer
x, a, b = map(int, input().split())
print("delicious" if a+b <= x else "dangerous")
v = a + b - x
if a > x:
  print("delicious")
elif v == 0:
  print("safe")
else:
  print("dangerous")
# Judge status: Accepted
n = int(input())
for i in range(n,n + 111):
    s = str(i)
    if s[0]== s[1] and s[1] == s[2]:
        print(i)
        break
# Judge status: Accepted
_ = input()
l = [int(a) for a in input().split(' ') if int(a)%2==0]

fl = 1
for n in l:
  if n%3==0 or n%5==0:
    pass
  else:
    fl = 0
    break

print('APPROVED' if fl else 'DENIED')
# Judge status: Accepted
if __name__ == '__main__':
    n = int(input())
    p = list(map(int, input().split(" ")))

    count = 0
    min_num = 10000000
    for i in p:
        if i < min_num:
            count = count + 1
            min_num = i

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

for i in range(1, 99):
    if n <= 26**i:
        n -= 1
        for j in range(i):
            ans += chr(ord('a') + n % 26)
            n //= 26
        break
    else:
        n -= 26 ** i

print(ans[::-1])
# Judge status: Wrong Answer
a,b=map(int,input().split())
A=a
B=b
while b%a>0:
  e=a
  a=b%a
  b=e

A=A//a
B=B//a
print(str(A),str(B),str(a))
print(str(int(A*B*a)))
# Judge status: Accepted
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
flg = True
r = v - w
y = abs(b - a)
if r < 0:
    flg = False

if t * r < y:
    flg = False

if flg:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
A, B, C = map(int, input().split())
K = int(input())
count = 0

while B <= A:
    B *= 2
    count += 1

while C <= B:
    C *= 2
    count += 1

print("Yes" if count <= K else "No")
# Judge status: Accepted
A,B=map(int,input().split())
N = 0
res = 0
def checkPali(n):
  # n = 100*a + 10*b +c
  c = n%10
  a = n//10000
  b = (n - 10000*a)//1000
  d = (n - c)/10
  e = d%10
  if a == c and b == e:
    return True
  else:
    return False
for i in range(B-A+1):
  N = A + i
  if checkPali(N):
    res+=1
print(res)
# Judge status: Accepted
s=input()

for i in "abcdefghijklmnopqrstuvwxyz":
  if i not in s:
    print(i)
    break
else:
  print("None")
# Judge status: Accepted
S = input()
f = int(S[:2])
l = int(S[2:])
if f==0 or f>12:
  if l==0 or l>12:
    print("NA")
  else:
    print("YYMM")
else:
  if l==0 or l>12:
    print("MMYY")
  else:
    print("AMBIGUOUS")
# Judge status: Wrong Answer
a=[ int(input()) for i in range(5)]
b=[(a[i]-1)%10 for i in range(5)]
m=10-((min(b)+1)%10)
def f(x):
  if x%10==0:
    return x
  else:
    return x-(x%10)+10
ans=-m
for i in range(5):
  ans+=f(a[i])
print(ans)
# Judge status: Wrong Answer
import math
n=int(input())
lis=list(map(int,input().split()))
i=0
while len(lis)<i:
  lis+=math.gcd(lis[i],lis[i+1])
print(lis[-1])
# Judge status: Wrong Answer
#!/usr/bin/env python3

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    N, l = map(int,input().split())
    s = []

    for i in range(N):
        s.append(input())

    s_sorted = sorted(s)
    answer = ""

    for i in range(N):
        answer += s[i]

    print(answer)

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
k, R = int(input()), 1
for i in range(1, k+10):
    if not R:
        print(i)
    R = (R * 10 % 7 + 7) % k
# Judge status: Accepted
N, M = map(int, input().split())
mod = 10**9 + 7

diff = N - M
if diff < 0:
    diff = -diff
if diff > 1:
    print(0)
    exit()

def perm(n, mod):
    p = 1
    for i in range(1, n + 1):
        p = (p * i) % mod
    return p

ans = perm(N, mod)
ans = (ans * perm(M, mod)) % mod
if diff == 0:
    ans = (ans * 2) % mod
print(ans)
# Judge status: Wrong Answer
import math

def prime_factorize(n):
    num_list = []
    for i in range(2,int(math.sqrt(n)) + 1):
        if n % i == 0 and i not in num_list:
            num_list.append(i)
            n //= i
    return (num_list)

N = int(input())
print(len(prime_factorize(N)))
# Judge status: Wrong Answer
n = int(input())
s = input()
x = s.count("(")
y = s.count(")")

if x > y:   
    s += ")"*abs(x-y)
else:
    s = "("*abs(x-y) + s
print(s)
# Judge status: Accepted
a, b = map(int, input().split())
c = 0
for i in range(a, b+1):
    if str(i) == str(i)[::-1]:
        c += 1
print(c)
# Judge status: Wrong Answer
from functools import reduce

N = int(input())
mod = 10**9 + 7


def powmod(val, n, mod):
    vals = [val]*n
    ret = reduce(lambda x, y : x * y % mod, vals)

    return ret

    # for i in range(n):
    #     ret = ret * val % mod

    return ret


all = powmod(10, N, mod)
b = powmod(9, N, mod)
c = powmod(8, N, mod)
# Judge status: Accepted
s = input()

chain = 0
max_chain = 0
for i in range(len(s)):
    if (s[i] == 'A' or s[i] == 'C' or s[i] == 'G' or s[i] == 'T'):
        chain += 1
    else:
        if(chain > max_chain):
            max_chain = chain
            chain = 0
    if (i == len(s)-1):
        if(chain > max_chain):
            max_chain = chain
            chain = 0
            
print(max_chain)
# Judge status: Accepted
a,b,t=map(int,input().split())
ans=0
while t+0.5-a>0:
  ans+=b
  t-=a
print(ans)
# Judge status: Accepted
N, x = map(int, input().split())
a = sorted(map(int, input().split()))
cnt = 0
for i in a:
    if x < i:
        break
    cnt += 1
    x -= i
else:
    if x > 0:
        cnt -= 1
print(cnt)
# Judge status: Wrong Answer
data = [i for i in input().split(" ")]
print('A#{}C'.format(data[1][0]))
# Judge status: Accepted
from collections import Counter

n = int(input())
s = []
for i in range(n):
  s.append(input())

cnt = -1
counter_s = Counter(s)
ans = []
for word, num in counter_s.most_common():
  if cnt == -1 or cnt == num:
    ans.append(word)
    cnt = num
  else:
    break

ans.sort()
for word in ans:
  print(word)
# Judge status: Accepted
n = int(input())
s = [input() for _ in range(n)]
print(len(set(s)))
# Judge status: Accepted
A, B, C = map(int, input().split())
if A+B+C >= 22:
  print('bust')
else:
  print('win')
# Judge status: Accepted
N, M, X, Y = map(int, input().split())
 
x = list(map(int, input().split()))
y = list(map(int, input().split()))
 
for z in range(X, Y+1):
    if X < z <= Y and max(x) < z and min(y) >= z:
        print('No War')
        break
else:
    print('War')
# Judge status: Accepted
s = input()
a = s.count("0")
b = s.count("1")
print(2*min(a, b))
# Judge status: Wrong Answer
S = list(input())
T = list(input())
count = 0
for s,t in zip(S,T):
    if s != t:
        count += 1
# Judge status: Accepted
a, b, c = map(int,input().split())
d = [a, b, c]
if d.count(5) == 2 and d.count(7) == 1:
    print("YES")
    
else:
    print("NO")
# Judge status: Accepted
def resolve():
    n, k = map(int, input().split())
    a=0
    for i in range(k,n+2):
        a+=(n*(n+1)/2)-((n-i)*(n-i+1)/2)
        a-=(i-1)*i/2-1
    print(int(a%(10**9+7)))
resolve()
# Judge status: Wrong Answer
from collections import deque
S = deque([input(), ])
q = int(input())
r = False
for _ in range(q):
    t = input().split()
    if len(t) == 1:
        r = not r
    else:
        t[1] = int(t[1]) - 1
        if (not t[1] and not r) or (t[1] and r):
            S.appendleft(t[2])
        else:
            S.append(t[2])
if r:
    S = list(S)
    print(''.join(S[::-1]))
else:
    print(''.join(S))
# Judge status: Wrong Answer
a,b = list(map(int, input().split())) 
if a < 10:
  print(b)
else:
  print(b-1000+100*a)
# Judge status: Accepted
n = int(input())
a = 0
for i in range(10):
    for j  in range(10):
        if i*j == n:
            a+= 1
if a == 0:
    print("No")
else:
    print("Yes")
# Judge status: Accepted
def main():
    n = int(input())
    p = list(map(int, input().split()))
    count = 0

    for i in range(n):

        if p[i] == i+1:
            count += 1

    if n - count <= 2:
        print('YES')
    else:
        print('NO')

if __name__ == '__main__':
    main()
# Judge status: Accepted
import math
a, b = map(int, input().split())
mean = (a + b) / 2.0
print(math.ceil(mean))
# Judge status: Accepted
X, Y = map(int,input().split())
MOD = 10 ** 9 + 7
if (X + Y) % 3 != 0 or 2 * X < Y or 2 * Y < X:
    print(0)
elif 2 * X == Y or 2 * Y == X:
    print(1)
else:
    turn = (X + Y) // 3
    turn2 = X - turn
    turn1 = turn - turn2
    ans = turn
    inv = [0, 1]
    for i in range(2, min(turn1, turn2) + 1):
        ans = ans * (turn - i + 1) % MOD
        ans = ans * (-inv[MOD % i] * (MOD // i)) % MOD
        inv.append((-inv[MOD % i] * (MOD // i)) % MOD)
    print(ans % MOD)
# Judge status: Accepted
a = int(input())
l = sorted([int(x) for x in input().split()])
count = 0
for i in range(a):
    for j in range(i+1,a):
        if l[i] != l[j]:
            for k in range(j+1,a):
                if l[i]+l[j] >l[k] and l[i]!=l[k] and l[j]!=l[k]:
                    count += 1
print(count)
# Judge status: Accepted
#c
x,k,d = map(int,input().split())

num = 0

x = abs(x)

if x//d <k:
    if (k-x//d)%2 == 0:
        num = (x%d)
    else:
        num = abs(x%d-d)
else:
    num = abs(x-d*k)

    
print(num)
# Judge status: Accepted
pd = list(input())
for i in range(len(pd)):
    if '?' in pd[i]:
        pd[i] = 'D'
    print(pd[i], end = '')
# Judge status: Accepted
N,A,B=map(int,input().split())
S=input()

a,b=0,0
for i in range(N):
  if a+b<A+B:
    if S[i]=='a':
      print('Yes')
      a += 1
    elif S[i]=='b' and b < B:
      print('Yes')
      b += 1
    else:
      print('No')
  else:
    print('No')
# Judge status: Accepted
# -*- coding: utf-8 -*-

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

print((t // a) * b)
# Judge status: Accepted
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    s = input()
    t = input()

    for _ in range(len(s)):
        if s == t:
            print('Yes')
            exit()
        else:
            s = s[-1] + s[:-1]
    print('No')

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
def framod(x,p=10**9+7):
  a=1
  for i in range(1,x+1):
    a = (a*i)%p
  return a
#############################################
X,Y=map(int,input().split())
p=10**9+7

if (X+Y)%3!=0:
  print(0)
else:
  a = (2*X-Y)//3
  b = (2*Y-X)//3
  t = a+b
  
  S=framod(t)
  T=pow(framod(a),p-2,p)
  U=pow(framod(b),p-2,p)
  
  print(S*T*U%p)
# Judge status: Wrong Answer
N = input()
A = list(map(int,input().split()))
n = 1

if 0 in A :
    print(0)

for i in range(len(A)):
    n *= A[i]

if n <= 10**18:
    print(N)
else:
    print(-1)
# Judge status: Accepted
H,W=map(int, input().split())
ans=H*(W//2)
if W&1:
    ans+=(H+1)//2
if H==1 or W==1:
    ans=1
print(ans)
# Judge status: Wrong Answer
S = input()
T = input()
ans = 0
if S == T:
  print(0)
else:
  for i in range(len(S)):
    if S[i] != T[i]:
      ans = ans + 1
print(ans)
# Judge status: Wrong Answer
S = input()
N = len(S)
for i in range(N//2):
    if S[i] != S[-i-1]:
        print('No')
        exit()
if N % 2 == 0 or N < 7:
    print('No')
    exit()

for i in range((N-1)//2):
    if S[i] != S[-i-1]:
        print('No')
        exit()

for i in range((N+3)//2):
    if S[i] != S[-i-1]:
        print('No')
        exit()
print('Yes')
# Judge status: Accepted
x,a,b=map(int,input().split())
DisXA=abs(a-x)
DisXB=abs(b-x)
if DisXA<DisXB:
    print('A')
else:
    print('B')
# Judge status: Accepted
n,k=map(int,input().split())
if n >= k:
    print(min(n%k,k-n%k))
elif n == 0:
    print(n)
else:
    print(min(n,k-n))
# Judge status: Wrong Answer
def resolve():
	n, m = map(int, input().split())
	A = []
	B = []
	ans = "No"
	for _ in range(n):
		A.append(list(input()))
	for _ in range(m):
		B.append(list(input()))
	for i in range(n):
		for j in range(n):
			if i + m - 1 >= n or j + m - 1 >= n:
				continue
			tmp_ans = True
			for k in range(m):
				for l in range(m):
					if A[i+k][j+l] != B[k][l]:
						tmp_ans = False
			ans = tmp_ans


	if ans:
		print('Yes')
	else:
		print('No')
resolve()
# Judge status: Accepted
n,m=map(int,input().split())
a=list(map(int, input().split()))
b=sorted(a)
ans=0
for i in range(m):
    ans+=b[i]

print(ans)
# Judge status: Wrong Answer
S=input()
a=int(S[0]+S[1])
b=int(S[2]+S[3])
if (a==0 or a>12) and 0<b<=12:
    print("YYMM")
elif 0<a<=12 and 0<b<=12:
    print("AMBIGUOUS")
elif 0<a<=12 and b>12:
    print("MMYY")
else:
    print("NA")
# Judge status: Accepted
def mysum(x):
    return x*(x+1)//2

ans=0
n=int(input())
for i in range(1,n+1):
    ans+=i*mysum(n//i)
print(ans)
# Judge status: Wrong Answer
n = int(input())

result = 0

for i in range(n):
  for j in range(n):
    for k in range(n):
      result += 1

print(result)
# Judge status: Accepted
N=int(input())
values=input().split()
for i in range(N):
  values[i]=int(values[i])
day=0
yen=1000
while day<N-1:
  if values[day+1]>values[day]:
    stocksbuyable=yen//values[day]
    yen+=stocksbuyable*(values[day+1]-values[day])
  day+=1
print(yen)
# Judge status: Wrong Answer
n = input()
flag = True
for i in range(len(n)-1):
    if i % 2 == 0 and n[i] == 'h' and n[i+1] == 'i':
        continue
    elif i % 2 == 1 and n[i] == 'i' and n[i+1] == 'h':
        continue
    else:
        flag = False
        break
if flag:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
K, X = map(int,input().split())
if 500*K >= X:
    print('yes')
else:
    print('no')
# Judge status: Accepted
N = int(input())
S = input()
half = divmod(N, 2)
result = False

if N % 2 == 0:
    if S[0:N // 2] == S[N // 2:]:
        result = True

if result:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
#!/usr/bin/python
# -*- coding: UTF-8 -*-

import sys


def input():
    return sys.stdin.readline().strip()


def _main():
    input()
    s = sorted(list(input().split()))
    print("".join(s))


if __name__ == "__main__":
    _main()
# Judge status: Accepted
s=input()
if       s=="Sunny":
    print("Cloudy")
elif   s=="Cloudy":
    print("Rainy")
else:
     print("Sunny")
# Judge status: Wrong Answer
def main():
  import sys
  a=int(input())
  b=tuple(range(1,a+1))
  c=tuple(sys.stdin.readline().split())
  d=[[i,j] for i,j in zip(b,c)]
  e=sorted(d,key=lambda x:x[1])
  f=" ".join([str(i[0]) for i in e])
  print(f)
if __name__=="__main__":
  main()
# Judge status: Accepted
n = float(input())
pi = 3.1415926535
print(2 * pi * n)
# Judge status: Wrong Answer
N,M=map(int,input().split())
A=[0]*(M+1)
cnt=0
for i in range(N):
  S=list(map(int,input().split()))
  for j in range(1,S[0]+1):
    A[S[j]]+=1
    #print(A)
print(A)
for i in range(len(A)):
  if A[i]>=N:
    cnt+=1
print(cnt)
# Judge status: Wrong Answer
X, K, D = map(int, input().split())
k = X//D
dk = K-k
dd = X-k*D

if dk>0:
    if dk%2:
        print(abs(dd-D))
    else:
        print(abs(dd))
else:
    print(X-K*D)
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
if (a+b)%4 == (b+c)%4 == (c+a)%4 == 0:
    print(-1)
else:
    counter = 0
    while a%2==b%2==c%2==0:
        a, b, c = (b+c)//2, (a+c)//2, (a+b)//2
        counter += 1
    print(counter)
# Judge status: Accepted
k , n = map(int, input().split())
a = list(map(int, input().split()))

min = a[-1] - a[0]

for i in range(1, n-1):
    dist = k + a[0+i] - a[1+i]
    if min > dist:
        min = dist

print(min)
# Judge status: Accepted
A,B,X = map(int,input().split())
from math import atan2, degrees, radians, tan

b = degrees(atan2(B,A))

def is_ok(d):
    if d > b:
        h = B * tan(radians(90-d))
        return X <= A*B*h/2
    else:
        h = B - A * tan(radians(d))
        return X <= A*A*(h+B)/2
ok = 0
ng = 90
for _ in range(100):
    m = (ok+ng)/2
    if is_ok(m):
        ok = m
    else:
        ng = m
print(ok)
# Judge status: Wrong Answer
S = str(input())

S1 = S.replace('01', '')
S2 = S1.replace('10', '')
S3 = S2.replace('01', '')
print(len(S)-len(S3))
# Judge status: Accepted
s = list(input())
t = list(set(s))
if len(t) == 2 and s.count(t[0]) == 2 :
    print("Yes")
else :
    print("No")
# Judge status: Accepted
s = int(input())
sl = [s]
count = 2
for i in range(10**6):
  s_next = 0
  if sl[i]%2 == 0:
    s_next = sl[i]//2
    sl.append(s_next)
  else:
    s_next = 3*sl[i]+1
    sl.append(s_next)
  if sl.count(s_next) > 1:
    print(count)
    break
  count += 1
# Judge status: Accepted
import math
import numpy as np
import sys
import os
from operator import mul

sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r")
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353    

N = I()

ans = 1
for i in range(N):
    ans *= (i+1)
    ans %= MOD

print(ans)
# Judge status: Accepted
N,A,B = list(map(int,input().split()))
L = [i for i in range(1,N+1) if A <= sum(map(int,(list(str(i))))) <= B]
print(sum(L))
# Judge status: Wrong Answer
N = int(input())
S = input()

from collections import Counter
c = Counter()

for si in S:
    c[si] += 1

print(c.values())

ans = 1
for n in c.values():
    ans *= n + 1

ans -= 1
ans = ans % (10 ** 9 + 7)
print(ans)
# Judge status: Accepted
s = input()
n = len(s)

ans = 0
for i in range(n//2):
  if s[i] != s[n-i-1]:
    ans += 1
    
print(ans)
# Judge status: Wrong Answer
n=int(input())
a=[]
for i in range(10):
    b=[]
    for j in range(10):
        b.append(0)
    a.append(b)
for i in range(n):
    b=str(i)
    a[int(b[0])][int(b[-1])]+=1
    b=0
for i in range(10):
    for j in range(10):
        b+=a[i][j]*a[j][i]
print(b-1)
# Judge status: Accepted
a, b = map(int, input().split())
r = a-1
if b-a>=0:
    r+=1
print(r)
# Judge status: Accepted
a, b, c = map(int, input().split())
k = int(input())
ans = 'Yes'

while a >= b:
    b *= 2
    k -= 1

while b >= c:
    c *= 2
    k -= 1

if k < 0:
    ans = 'No'

print(ans)
# Judge status: Wrong Answer
n,k=map(int,input().split())
a=sorted(list(map(int,input().split())))
def groupby(src_list):
  dest_list=[[src_list[0],1]]
  print(dest_list)
  for i in range(1,len(src_list)):
    if dest_list[-1][0]==src_list[i]:
      dest_list[-1][1]+=1
    else:
      dest_list.append([src_list[i],1])
  return dest_list
b=groupby(a)
b.sort(key=lambda x:x[1],reverse=True)
l=len(b)
ans=0
for i in range(k,l):
  ans+=b[i][1]
print(ans)
# Judge status: Accepted
a,b = map(int,input().split())

if a*b %2 == 0:
  judge = 'Even'
else:
  judge='Odd'

print(judge)
# Judge status: Accepted
from collections import Counter

n, k = map(int, input().split())
b_list = list(map(int, input().split()))
mycounter = Counter(b_list)

ans = n

for i in mycounter.most_common(k):
  ans -= i[1]
print(ans)
# Judge status: Accepted
n, k = map(int, input().split())
A = list(map(int, input().split()))

max_a = max(A)
min_a = 0

while abs(max_a - min_a) > 1:
    cnt = 0
    target_length = (max_a + min_a)//2
    for a in A:
        cut_num = (a + target_length - 1)//target_length
        cnt += cut_num - 1
    if cnt > k:
        min_a = target_length
    else:
        if target_length - min_a == 1:
            print(target_length)
            exit()
        max_a = target_length

print(max_a)
# Judge status: Wrong Answer
total = sum([sum(list(map(int, input().split()))) for i in range(3)])
if total % 3 == 0:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
a,b=map(int,input().split())
b=b*2+1
c=0
c=a/b
if c>b:
  print(c+1)
else:
  print(c)