Harryxun/stf_run huggingface dataset:
import numpy as np

N, M = list(map(int, input().split(" ")))
A_list = np.sort(np.asarray(list(map(int, input().split(" ")))))[::-1]
B_list = np.sort(np.asarray(list(map(int, input().split(" ")))))[::-1]

out = 1
a_next_i = 0
b_next_i = 0
for x in range(N*M, 1, -1):
    cond1 = a_next_i < N and x == A_list[a_next_i]
    cond2 = b_next_i < M and x == B_list[b_next_i]
    if cond1 and cond2:
        kosuu = 1
        a_next_i += 1
        b_next_i += 1
    elif cond1:
        kosuu = b_next_i
        a_next_i += 1
    elif cond2:
        kosuu = a_next_i
        b_next_i += 1
    else:
        kosuu = a_next_i * b_next_i - (N * M - x)
    out *= kosuu
    out = out % 1000000007
   
print(out)

### FIXED CODE ###

import numpy as np

N, M = list(map(int, input().split(" ")))
A_list = np.sort(np.asarray(list(map(int, input().split(" ")))))[::-1]
B_list = np.sort(np.asarray(list(map(int, input().split(" ")))))[::-1]

out = 1
a_next_i = 0
b_next_i = 0
for x in range(N*M, 1, -1):
    #if x in A_list and x in B_list:
    if a_next_i < N and x == A_list[a_next_i] and b_next_i < M and x == B_list[b_next_i]:
        kosuu = 1
        a_next_i += 1
        b_next_i += 1
    #elif x in A_list:
    elif a_next_i < N and x == A_list[a_next_i]:
        #kosuu = np.sum(B_list >= x)
        kosuu = b_next_i
        a_next_i += 1
    #elif x in B_list:
    elif b_next_i < M and x == B_list[b_next_i]:
        #kosuu = np.sum(A_list >= x)
        kosuu = a_next_i
        b_next_i += 1
    else:
        #kosuu = np.sum(A_list >= x) * np.sum(B_list >= x) - (N * M - x)
        kosuu = a_next_i * b_next_i - (N * M - x)
    out *= kosuu
    out = out % 1000000007
   
print(out)

#print(A_list)
#print(B_list)
a, b = input().split("\n")
array = list(map(int,b.split()))
print(min(array), max(array), sum(array))


### FIXED CODE ###

input()
array = list(map(int, input().split()))
print(min(array), max(array), sum(array))
def make_divisors(n):
    lower_divisors, upper_divisors = [], []
    i = 1
    while i * i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors, upper_divisors


n = int(input())
low, up = make_divisors(n)
if len(low) != 1:
    ans = low[0] + up[0]
    for i in range(1, len(low)):
        tmp = low[i] + up[i]
        if tmp < ans:
            ans = tmp
    print(tmp - 2)
else:
    print(n - 1)

### FIXED CODE ###

def make_divisors(n):
    lower_divisors, upper_divisors = [], []
    i = 1
    while i * i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            upper_divisors.append(n//i)
        i += 1
    return lower_divisors, upper_divisors


n = int(input())
low, up = make_divisors(n)
if len(low) != 1:
    # ans = low[0] + up[0]
    # for i in range(1, len(low)):
    #     tmp = low[i] + up[i]
    #     if tmp < ans:
    #         ans = tmp
    print(low[-1] + up[-1] - 2)
else:
    print(n - 1)
import bisect
n=int(input())
a=[int(input()) for i in range(n)]
inf=10**6
tmp=[inf]*(n+1)
ans=0
for i in range(n-1,-1,-1):
  j= bisect.bisect_right(tmp,a[i])
  tmp[j]=a[i]
for i in range(n):
  if tmp[i]!=inf:
    ans+=1
print(ans)

### FIXED CODE ###

import bisect
n=int(input())
a=[int(input()) for i in range(n)]
inf=10**9+1
tmp=[inf]*n
ans=0
for i in range(n-1,-1,-1):
  j= bisect.bisect_right(tmp,a[i])
  tmp[j]=a[i]
for i in range(n):
  if tmp[i]!=inf:
    ans+=1
print(ans)
#ABC058B
o = input()
e = input()

for i in range(len(o)):
    print(o[i]+e[i],end="")

### FIXED CODE ###

o = list(input())
e = list(input())+[""]

for i,j in zip(o,e): print(i+j,end="")
a=map(int,input().split())

print(a+a**2+a**3)


### FIXED CODE ###



a=int(input())

print(a+a**2+a**3)
print(int(input)*2)

### FIXED CODE ###

N = int(input())
if N % 2 == 0:
  print(N)
else:
  print(N*2)
def main():
  A,B = input.split()
  A = int(A)
  B = round(float(B)*100)

  res = (A*B)//100
  print(res)
  return
 
main()

### FIXED CODE ###

A,B = input().split()
A = int(A)
B = round(float(B)*100)

res = (A*B)//100
print(res)
N = int(input())
vector_list = ([int(x) for x in input().split()])
cost_list = ([int(x) for x in input().split()])
ans = 0
for i in range(N):
  if vector_list[i]-cost_list[i]>0:
    ans += vector_list[i]-cost_list[i]

print(ans)



### FIXED CODE ###

#スペース区切りの整数の入力
A, B, T= map(int, input().split())
ans = (int(T/A))*B
print("{}".format(ans))
A, P = map(int, input().split())
D = 3*A + P
if D % 2 == 0:
    print(int(D/2))
else:
    print(round(int((D/2))

### FIXED CODE ###

A, P = map(int, input().split())
D = 3*A + P
print(D//2)
a = input("insert a here")

if a.isupper():dfdf
    print('A')
else:
    print('a')

### FIXED CODE ###

a = input()

if a.isupper():
    print('A')
else:
    print('a')
def main():
    def kaizyo(x):
        ans = 1
        for i in range(2, x+1):
            ans *= i
        return ans

    n, m, k = map(int, input().split())
    MAX = 998244353
    ans = 0
    kaizyos = [None]*n
    ki = 1
    kaizyos[0] = ki
    for i in range(1, n):
        ki *= i
        ki %= MAX
        kaizyos[i] = ki
    def comb(a, b):
        return kaizyos[a]//(kaizyos[b]*kaizyos[a-b])
    ruizyos = [None]*(k+1)
    ruizyo = 1
    for i in range(n-1-k):
        ruizyo *= m-1
        ruizyo %= MAX
    ruizyos[0] = ruizyo
    for i in range(n-k, n):
        ruizyo *= m-1
        ruizyo
        ruizyos[i-n-k+1] = ruizyo
    pattern = lambda x: (comb(n-1, x)*m*ruizyos[x])%MAX
    for i in range(k+1):
        ans += pattern(i)
        ans %= MAX
    print(ans)


if __name__ == "__main__":
    main()

### FIXED CODE ###

def main():
    n, m, k = map(int, input().split())
    mod = 998244353
    ans = 0
    m1 = [None]*(n+1)
    kaizyo = [None]*(n+1)
    nm1 = 1
    kai = 1
    for i in range(n+1):
        m1[i] = nm1
        nm1 *= m-1
        nm1 %= mod
        kaizyo[i] = kai
        kai *= i+1
        kai %= mod
    
    def comb(a, b):
        return (kaizyo[a]*fermat(kaizyo[a-b]*kaizyo[b], mod))%mod

    for i in range(k+1):
        ans += m*m1[n-i-1]*comb(n-1, i)
        ans %= mod
    
    print(ans)

def fermat(x, p):
    """
    1/x (mod p) を返す
        x**(p-1) ≡ 1    [if gcd(x, p) == 1]
        x**(p-2) ≡ 1/x
        繰返し二乗法 
            ex: x**50  = (x**25)**2
                x**25  = (x**12)**2 * x
                x**12  = (x**6)**2
                x**6   = (x**3)**2
    """
    times = []
    mod = p
    p -= 2
    while p > 1:
        times.append(p%2)
        p //= 2
    x %= mod
    out = x
    for i in times[::-1]:
        if i:
            out = (x*pow(out, 2, mod))%mod
        else:
            out = pow(out, 2, mod)
    return out



if __name__ == "__main__":
    main()
s,t=input().split()
a,b=map(int(),input().split())
u=input()
print(a-1,b if u==s else a,b-1)


### FIXED CODE ###

s,t=input().split()
a,b=map(int,input().split())
u=input()
print(a-1,b) if u==s else print(a,b-1)
import random
n = input()
num = map(int, raw_input().split())
while not sorted(num) == num:
    l = list()
    for i in xrange(n*2):
        if sorted(num) == num:
            break
        a = random.randint(0, n-1)
        b = random.randint(0, n-1)
        num[a] += num[b]
        l.append("%d %d" % ((a+1), (b+1)))

print len(l)
for i in l:
    print i


### FIXED CODE ###

n = input()
num = map(int, raw_input().split())
ma = max(num)
mi = min(num)
l = list()
if ma*mi < 0:
    if ma > abs(mi):
        index = num.index(ma)
    else:
        index = num.index(mi)
    for i in xrange(n):
        l.append("%d %d" % (index+1, i+1))
    b = num[index]
else:
    b = 0
    for i in num:
        if i:
            b = i
            break

if b == 0:
    pass
elif b < 0:
    for i in xrange(n-1, 0, -1):
        l.append("%d %d" % (i+1, i))
else:
    for i in xrange(0, n-1):
        l.append("%d %d" % (i+1, i+2))

print len(l)
for i in l:
    print i
N, C = map(int, input().split())

f = [[0] * 100000 for _ in range(C)]

for i in range(N):
    s, t, c = map(int, input().split())
    f[c-1][s-1] = 1
    f[c-1][t] = -1

for c in range(C):
    for i in range(100000):
        if i > 0:
            f[c][i] += f[c][i-1]

print(max(map(sum, zip(*f))))

### FIXED CODE ###

N, C = map(int, input().split())
 
f = [[0] * 100000 for _ in range(C)]
 
for i in range(N):
    s, t, c = map(int, input().split())
    f[c-1][s-1:t] = [1] * (t-s+1)
 
print(max(map(sum, zip(*f))))
mod = 10**9+7
N, = map(int, input().split())
dp1 = [0]*N
dp2 = [0]*N
for i in range(N):
    if i < 3:
        dp1[i] = 1
        dp2[i] = 0
    else:
        dp1[i] = dp1[i-1] + dp2[i-1]
        dp2[i] = dp1[i-3] + dp2[i-3]
    dp1[i] %= mod
    dp2[i] %= mod
print(dp1)
print(dp2)
print((dp1[-1]+dp2[-3])%mod)


### FIXED CODE ###

import sys
input=sys.stdin.readline
mod = 10**9+7
 
def cmb(n, r):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod
 
NNN = 2*10**5
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]
 
for i in range( 2, NNN + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

def ff(N, M):
    R = 0
    for i in range(1, M+1):
        R += (-1 if (M-i)%2 else 1) * cmb(M, i) * pow(i, N, mod) % mod
    R = R*cmb(N, M)%mod
    return R
 
N, = map(int, input().split())
R = 0
for i in range(1, N):
    M=N-2*i
    if N < M:
        break
    R += cmb(M-1,i-1)
    R %= mod

print(R)
def solve():
     
        n, a, b = map(int, input().split())
        mod = 10**9 + 7
     
        # 繰り返し二乗法 使ってない
        def modPow(a, n, mod):
            if n == 1:
                return a
            elif n%2 == 1:
                return a * modPow(a, n-1, mod) % mod
            else:
                t = modPow(a, n/2, mod)
                return (t * t) % mod
     
        def combination(n, a, mod):
            x = 1
            y = 1
            for i in range(a):
                x = x * (n-i)%mod
                y = y * (a-i)%mod
                #遅い
                #x *= (n-i)%mod
                #y *= (a-i)%mod
            return x * pow(y, mod-2, mod)%mod
     
        #全ての選び方
        sigma_nCi = pow(2, n, mod)
        # nCa, nCb
        nCa = combination(n, a, mod)
        nCb = combination(n, b, mod)
     
        ans = sigma_nCi - 1 - nCa - nCb
     
        #print(Sigma_nCi, nCa, nCb)
        print(ans%mod)
     
    if __name__ == '__main__':
        solve()

### FIXED CODE ###

def solve():

    n, a, b = map(int, input().split())
    mod = 10**9 + 7

    # 繰り返し二乗法
    def modPow(a, n, mod):
        if n == 1:
            return a
        elif n%2 == 1:
            return a * modPow(a, n-1, mod) % mod
        else:
            t = modPow(a, n/2, mod)
            return (t * t) % mod

    def combination(n, a, mod):
        x = 1
        y = 1
        for i in range(a):
            x = x * (n-i)%mod
            y = y * (a-i)%mod

            #x *= (n-i)
            #x %=mod
            #y *= (a-i)
            #y %=mod
        return x * pow(y, mod-2, mod)%mod

    #全ての選び方
    sigma_nCi = pow(2, n, mod)
    # nCa, nCb
    nCa = combination(n, a, mod)
    nCb = combination(n, b, mod)

    ans = sigma_nCi - 1 - nCa - nCb

    #print(Sigma_nCi, nCa, nCb)
    print(ans%mod)

if __name__ == '__main__':
    solve()
def bomb(f,x,y):
    rf=f[:][:]
    rf[y][x]=0
    for i in [-3,-2,-1,1,2,3]:
        if 0<=x+i<=7:
            if rf[y][x+i]==1:
                rf=bomb(rf,x+i,y)
        if 0<=y+i<=7:
            if rf[y+i][x]==1:
                rf=bomb(rf,x,y+i)
    return rf

n=int(raw_input())
for data in range(1,n+1):
    raw_input()
    f=[]
    for i in range(8):
        l.append([int(x) for x in raw_input()])
    x=int(raw_input())-1
    y=int(raw_input())-1
       # map(int,raw_input().split())
    f=bomb(f,x,y)
    print "Data %d:"%(data)
    for i in range(8):
        print ''.join(map(str, f[i]))

### FIXED CODE ###

def bomb(f,x,y):
    rf=f[:][:]
    rf[y][x]=0
    for i in [-3,-2,-1,1,2,3]:
        if 0<=x+i<=7:
            if rf[y][x+i]==1:
                rf=bomb(rf,x+i,y)
        if 0<=y+i<=7:
            if rf[y+i][x]==1:
                rf=bomb(rf,x,y+i)
    return rf

n=int(raw_input())
for data in range(1,n+1):
    raw_input()
    f=[]
    for i in range(8):
        f.append([int(x) for x in raw_input()])
    x=int(raw_input())-1
    y=int(raw_input())-1
       # map(int,raw_input().split())
    f=bomb(f,x,y)
    print "Data %d:"%(data)
    for i in range(8):
        print ''.join(map(str, f[i]))
N,M=map(int,input().split())
a=[0]*M
for i in range(M):
  a[i]=int(input())
dp=[1]*(N+1)
mod=10**9+7
j=0
if a[j]==1:
  j=j+1
  dp[1]=0
for i in range(2,N+1):
  if j==0:
    if i==a[j]:
      dp[i]=0
      if j < M-1:
        j=j+1
      else:
        a[j]=-1
    else:
      dp[i]=(dp[i-1]+dp[i-2])%mod
  else:
    if i==a[j] and i-1 !=a[j-1]:
      dp[i]=0
      if j < M-1:
        j=j+1
      else:
        a[j]=-1
    elif i==a[j] and i-1 ==a[j-1]:
      dp[N]=0
      break
    elif i-2 ==a[j-1]:
      dp[i]=dp[i-1]
    elif i-1 ==a[j-1]:
      dp[i]=dp[i-2]
    elif i-1 !=a[j-1] and i-2 !=a[j-1]:
      dp[i]=(dp[i-1]+dp[i-2])%mod
print(dp[N]%mod)

### FIXED CODE ###

N,M=map(int,input().split())
a=[0]*M
for i in range(M):
  a[i]=int(input())
dp=[1]*(N+1)
mod=10**9+7
if M >=2:
  j=0
  if a[j]==1:
    j=j+1
    dp[1]=0
  for i in range(2,N+1):
    if j==0:
      if i==a[j]:
        dp[i]=0
        if j < M-1:
          j=j+1
        else:
          a[j]=-1
      else:
        dp[i]=(dp[i-1]+dp[i-2])%mod
    else:
      if i==a[j] and i-1 !=a[j-1]:
        dp[i]=0
        if j < M-1:
          j=j+1
        else:
          a[j]=-1
      elif i==a[j] and i-1 ==a[j-1]:
        dp[N]=0
        break
      elif i-2 ==a[j-1]:
        dp[i]=dp[i-1]
      elif i-1 ==a[j-1]:
        dp[i]=dp[i-2]
      elif i-1 !=a[j-1] and i-2 !=a[j-1]:
        dp[i]=(dp[i-1]+dp[i-2])%mod
elif M==0:
  for i in range(2,N+1):
    dp[i]=(dp[i-1]+dp[i-2])%mod
else:
  for i in range(2,N+1):
    if i==a[0]:
      dp[i]=0
    elif i-2==a[0]:
      dp[i]=dp[i-1]
    elif i-1==a[0]:
      dp[i]=dp[i-2]
    else:
      dp[i]=(dp[i-1]+dp[i-2])%mod
print(dp[N]%mod)
def chess(h,w):
  if (h+w) % 2 == 0:
    return '#'
  return '.'

while True:
  H, W = map(int, input().split())
  if H == 0 and W == 0:
    break
  for i in range(H):
    for j in range(W):
      print(chess(I,j), end='')
    print()
  print()



### FIXED CODE ###

def chess(h,w):
  if (h+w) % 2 == 0:
    return '#'
  return '.'

while True:
  H, W = map(int, input().split())
  if H == 0 and W == 0:
    break
  for i in range(H):
    for j in range(W):
      print(chess(i,j), end='')
    print()
  print()
t=input()
h=t/3600
m=t/3600%60
s=t-h*3600-m*60
print('%d:%d:%d'%(h,m,s))

### FIXED CODE ###

t=int(input())
h=t//3600
m=(t%3600)//60
s=t-h*3600-m*60
print('{}:{}:{}'.format(h,m,s))
from sys import exit
from math import sqrt
n = int(input())
a = [int(input()) for _ in range(n+1)]
x = 0
while True:
	m = abs(sum([a[i]*pow(x, n-i) for i in range(n+1)]))
	if m != 0:
		break
	x += 1
ans, ps = [], []
for i in range(2, int(sqrt(m))+1):
	if m%i == 0:
		ps.append(i)
		while m%i == 0:
			m //= i
if m != 1:
	ps.append(m)
if n == 0:
	if ps:
		print(*ps, sep="\n")
	exit()
a = a[::-1]
for p in ps:
	if p-1 > n:
		ng = False
		for i in range(1, n+1):
			if a[i]%p != 0:
				ng = True
				break
		if not ng:
			print(p)
	else:
		mods = [0 for _ in range(p-1)]
		for i in range(1, n+1):
			mods[i%(p-1)] += a[i]
			mods[i%(p-1)] %= p
		if mods[0] == 0:
			ng = False
			for i in range(1, p-1):
				if mods[i] != 0:
					ng = True
					break
			if not ng:
				print(p)

### FIXED CODE ###

import sys
from fractions import gcd
n = int(input())
a = [int(input()) for _ in range(n+1)]
x = 0
while True:
	m = abs(sum([a[i]*pow(x, n-i) for i in range(n+1)]))
	if m != 0:
		break
	x += 1
ps = []

i = 2
while i**2 <= m and i <= n+1:
#for i in range(2, int(sqrt(m))+1):
	if m%i == 0:
		ps.append(i)
		while m%i == 0:
			m //= i
	i += 1
if m != 1 and n != 0:
	ps.append(m)
#print(ps)
g = a[0]
for i in range(1, n+1):
	g = gcd(g, abs(a[i]))

#print(g)
ans = []

i = 2
while i**2 <= g:
#for i in range(2, int(sqrt(m))+1):
	if g%i == 0:
		if i >= n+1:
			ans.append(i)
		while g%i == 0:
			g //= i
	i += 1
if g != 1 and g >= n+1:
	ans.append(g)

a = a[::-1]
for p in ps:
	if p-1 > n:
		ng = False
		for i in range(1, n+1):
			if a[i]%p != 0:
				ng = True
				break
		if not ng:
			ans.append(p)
	else:
		mods = [0 for _ in range(p-1)]
		for i in range(1, n+1):
			mods[i%(p-1)] += a[i]
			mods[i%(p-1)] %= p
		if mods[0] == 0:
			ng = False
			for i in range(1, p-1):
				if mods[i] != 0:
					ng = True
					break
			if not ng:
				ans.append(p)
ans = sorted(list(set(ans)))
if ans:
	print(*ans, sep="\n")
import math as M
def R(A): return (A[0]**2+A[1]**2)**.5
def I(i): return [map(int,raw_input().split()) for _ in [0]*i]
def C(a,b): return a>b or abs(a-b)<1e-6
def f(e1):
  tx,ty,sx,sy=e1
  x=[]
  for e2 in WP:
    wx,wy,r=e2
    wt=[tx-wx,ty-wy]; rwt=R(wt)
    sw=[wx-sx,wy-sy]; rsw=R(sw)
    st=[tx-sx,ty-sy]; rst=R(st)
    F=[rwt<r,rsw<r]
    if rst==0: c=1
    elif F==[1,1]: c=1 # 両方壁の中
    elif F==[1,0] or F==[0,1]: c=0 # 片方が壁の中
    elif F==[0,0]: #両方壁の外
      a=M.pi/2-M.acos(r/rsw)
      #tmp=0#(sw[0]*st[0]+sw[1]*st[1])/rsw/rst
      #if abs(abs(tmp)-1)<1e-6: tmp=1
      b=0#M.acos(tmp/2)
      #if C(a,b) and C(rst**2,rsw**2-r**2): c=0
      #else: c=1
    x.append(c)
  return all(x)

while 1:
  n=input()
  if n==0: break
  WP=I(n)
  P=I(input())
  for e in P: print ["Safe","Danger"][f(e)]

### FIXED CODE ###

import math as M
def R(A): return (A[0]**2+A[1]**2)**.5
def I(i): return [map(int,raw_input().split()) for _ in [0]*i]
def C(a,b): return a>b or abs(a-b)<1e-6
def f(e1):
  tx,ty,sx,sy=e1
  x=[]
  st=[tx-sx,ty-sy]; rst=R(st)
  for e2 in WP:
    wx,wy,r=e2
    wt=[tx-wx,ty-wy]; rwt=R(wt)
    sw=[wx-sx,wy-sy]; rsw=R(sw)
    F=[rwt<r,rsw<r]
    if F==[1,0] or F==[0,1]: return 0
    elif F==[0,0]:
      a=M.pi/2-M.acos(r/rsw)
      b=M.acos(round((sw[0]*st[0]+sw[1]*st[1])/rsw/rst,4))
      if C(a,b) and C(rst**2,rsw**2-r**2): return 0
  return 1

while 1:
  n=input()
  if n==0: break
  WP=I(n)
  P=I(input())
  for e in P: print ["Safe","Danger"][f(e)]
# https://atcoder.jp/contests/abc085/tasks/abc085_c

    # N枚、Y円
    N, Y = map(int, input().split())

    for i in range(N):
        for j in range(N):
            
            z = N - (i + j)

            if z < 0:
                continue

            if i*1000 + j*5000 + z*10000 == Y:
                print(i, j, z)
                exit()

    print(-1, -1, -1)






    # ダメな例
    # def dfs(total, c_1000, c_5000, c_10000, count_bill):

    #     if count_bill == N and total == Y:
    #         print(c_1000, c_5000, c_10000)
    #         exit()

    #     elif count_bill == N:
    #         return


    #     dfs(total + 1000, c_1000+1, c_5000, c_10000, count_bill+1)

    #     dfs(total + 5000, c_1000, c_5000+1, c_10000, count_bill+1)

    #     dfs(total + 10000, c_1000, c_5000, c_10000+1, count_bill+1)

    # dfs(0, 0, 0, 0, 0)
    # print(-1, -1, -1)

### FIXED CODE ###

# https://atcoder.jp/contests/abc085/tasks/abc085_c

# N枚、Y円
N, Y = map(int, input().split())

for i in range(N + 1):
    for j in range(N + 1):
        
        z = N - (i + j)

        if z < 0:
            continue

        total = i*1000 + j*5000 + z*10000
        
        if total == Y:
            print(z, j, i)
            exit()

print('-1 -1 -1')
N, M = (int(i) for i in input().split())
DP[N] = [False]*N
for i in range(M):
  a, b = (int(i) for i in input().split())
  for i in (a, b):
    DP[i-1] = not DP[i-1]
for i in range(N):
  if DP[i]:
    print(NO)
    break
else:
  print(YES)

### FIXED CODE ###

N, M = (int(i) for i in input().split())
DP = [False]*N
for i in range(M):
  a, b = (int(k) for k in input().split())
  for j in (a, b):
    DP[j-1] = not DP[j-1]
for i in range(N):
  if DP[i]:
    print('NO')
    break
else:
  print('YES')
x = input()

while True:
    flg = True
    for i in range(2, x):
        if x % i == 0.0:
            flg = False
            break
    if flg:
        print(x)
        break
    x += 1

### FIXED CODE ###

x = int(input())

while True:
    flg = True
    for i in range(2, x//2+1):
        if x % i == 0.0:
            flg = False
            break
    if flg:
        print(x)
        break
    x += 1
def B():
    n = int(input())
    mul4 = n % 4
    mul8 = n % 8
    mul7 = n % 7
    mul6 = n % 6
    mul11 = n % 11

    YES='Yes'
    NO='No'

    if mul4==0 or mul7==0 or mul11==0:
        print(YES)
    elif mul7 % 4==0:
        print(YES)
    elif mul8 % 7==0:
        print(YES)
    elif n==30 or n==60 or n==90:
        print(YES)
    else:
        print(NO)
        

if __name__ =='__main__':
    B()

### FIXED CODE ###

def A():
    a = input().split()
    if len(a) ==2:            
        n = int(a[0])
        k = int(a[1])
        if n % k != 0:
            print(1)
        else:
            print(0)


if __name__ =='__main__':
    A()
import math
A, B = map(int, input().split())
def okasi(x, y):
    return (x * y) // math.gcd(x, y)

print(okasi(A,B))

### FIXED CODE ###

def gcd(a, b):
    while b > 0:
        a, b = b, a%b
    return a

A, B = map(int, input().split())
def okasi(x, y):
    return (x * y) // gcd(x, y)

print(okasi(A,B))
import os,sys
c=0

n=input()
for i in range(int(n)):
    m=input()
    one=m[0]
    two=m[2]
    if(one==two):
        c+=1
    
if(c>=3):
    print('Yes')
else:
    print('No')


### FIXED CODE ###

import os,sys

s=input()
n=len(s)
if s[n-1]=='s':
    s=s+'es'
else:
    s=s+'s'

print(s)
N,M = map(int,input().split())
PS = [list(map(str,input().split())) for i in range(M)]
A_num = [0]*N
W_num = [0]*N
w=0
#print(PS)
for j in range(M):
    #print(A_num)
    if PS[j][1] == 'WA'and A_num[int(PS[j][0])-1]==0:
        W_num[int(PS[j][0]-1)]=1 
    if PS[j][1]== 'AC' and A_num[int(PS[j][0])-1]==0:
        A_num[int(PS[j][0])-1]=1
s = sum(A_num)
for k in range(N):
    if A_num[k] == 0:
        W_num[k]=0
w = sum(W_num)
print(s,w)

### FIXED CODE ###

N,M = map(int,input().split())
PS = [list(map(str,input().split())) for i in range(M)]
A_num = [0]*N
W_num = [0]*N
w=0
#print(PS)
for j in range(M):
    #print(A_num)
    if PS[j][1] == 'WA'and A_num[int(PS[j][0])-1]==0:
        W_num[int(PS[j][0])-1]+=1 
    if PS[j][1]== 'AC' and A_num[int(PS[j][0])-1]==0:
        A_num[int(PS[j][0])-1]=1
s = sum(A_num)
for k in range(N):
    if A_num[k] == 0:
        W_num[k]=0
w = sum(W_num)
print(s,w)
N, Q = map(int, input().split())
ki = [[[],0] for i in range(N)]

def dfs(ki_elms, num, ki, result):
    num_tmp = num+ki_elms[1]
    result += str(num_tmp) + " "
    if not ki_elms[0]:
        return result
    for child in ki_elms[0]:
        result = dfs(ki[child], num_tmp, ki, result)
    return result

for i in range(N-1):
    a, b = map(int, input().split())
    ki[a-1][0].append(b-1)

for i in range(Q):
    p, x = map(int, input().split())
    ki[p-1][1] += x

print(dfs(ki[0], 0, ki, "").rstrip())

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
n,q=[int(_) for _ in input().split()]
ki=[[] for _ in range(n)]
ans=[0]*n
 
def dfs(numQ,parent):
    for child in ki[numQ]:
        if child==parent:
            continue
        ans[child]+=ans[numQ]
        dfs(child,numQ)
 
for i in range(n-1):
    a,b=[int(_) for _ in input().split()]
    ki[a-1].append(b-1)
    ki[b-1].append(a-1)
 
for i in range(q):
    p,x=[int(_) for _ in input().split()]
    ans[p-1]+=x
 
dfs(0,-1)
print(*ans)
if input() == 7 or input() == 5 or input() == 3:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

a=int(input())
if(a==7 or a==5 or a==3):
  print("YES")
else:
  print("NO")
from sys import exit, stdin
N, M = [int(_) for _ in stdin.readline().rstrip().split()]
r = M-2*N
if r <= 0:
    print(N//2)
else:
    pritnt(N+r//4)

### FIXED CODE ###

from sys import exit, stdin
N, M = [int(_) for _ in stdin.readline().rstrip().split()]
r = M-2*N
if r <= 0:
    print(M//2)
else:
    print(N+r//4)
a, b = int(raw_input().split())

if a > b:
    print "a > b"
elif a < b:
    print "a < b"
else:
    print "a == b"

### FIXED CODE ###

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

if a == b:
  print 'a == b'
elif a < b:
  print 'a < b'
else:
  print 'a > b'