Harryxun/stf_run huggingface dataset:
n, m = map(int, input().split(' '))
steps = [int(input()) for _ in range(m)]

def stepcmb(st):
    memo = [0]*(st+1)
    memo[0] = 1
    def _fib(st):
        if st <= 1:
            return 1
        if memo[st] != 0:
            return memo[st]
        memo[st] = _fib(st-1) + _fib(st-2)
        return memo[st]
    return _fib(st)

if m >= 2:
    for i in range(1, m):
        if steps[i] - steps[i-1] == 1:
            print(0)
            exit()

res = 1
nowstep = 0
for i in range(m):
    res *= stepcmb(steps[i]-nowstep-1) % (10**9+7)
    nowstep = steps[i] + 1
res = (res * stepcmb(n-nowstep)) % (10**9+7)

print(res)

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)

n, m = map(int, input().split(' '))
steps = [int(input()) for _ in range(m)]

def stepcmb(st):
    memo = [0]*(st+1)
    memo[0] = 1
    def _fib(st):
        if st <= 1:
            return 1
        if memo[st] != 0:
            return memo[st]
        memo[st] = _fib(st-1) + _fib(st-2)
        return memo[st]
    return _fib(st)

if m >= 2:
    for i in range(1, m):
        if steps[i] - steps[i-1] == 1:
            print(0)
            exit()

res = 1
nowstep = 0
for i in range(m):
    res *= stepcmb(steps[i]-nowstep-1) % (10**9+7)
    nowstep = steps[i] + 1
res = (res * stepcmb(n-nowstep)) % (10**9+7)

print(res)
# https://img.atcoder.jp/abc054/editorial.pdf

N, M = map(int, input().split())

graph = [[False for _ in range(N)] for i in range(N)]
for i in range(N):
  a, b = map(int, input().split())
  graph[a-1][b-1] = graph[b-1][a-1] = True

def dfs(v, visited):
  all_visited = True
  for i in range(N):
    if not visited[i]:
      all_visited = False
      
  if all_visited:
    return 1
  
  ret = 0
  for i in range(N):
    if not graph[v][i]: continue
    if visited[i]: continue
    
    visited[i] = True
    ret += dfs(i, visited)
    visited[i] = False
  
  return ret

visited = [False] * N
visited[0] = True
ans = dfs(0, visited)
print(ans)


### FIXED CODE ###

import itertools

N, M = map(int, input().split())
ab = [0] * M
for i in range(M):
  ab[i] = list(map(int, input().split()))

perms = itertools.permutations(range(1, N+1))
ans = 0
for perm in perms:
  if perm[0] != 1:
    continue
  is_goal = True
  for i in range(N-1):
    a = perm[i]
    b = perm[i+1]
    if not a < b:
      a, b = b, a
    if not [a, b] in ab:
      is_goal = False
  if is_goal:
    ans += 1

print(ans)
def com(n):
    return n*(n-1)//2
ans=0
n=int(input())
a=list(map(int,input().split()))
coun=[0]*n
for i in range(n):
    coun[a[i]]+=1
for i in range(n+1):
    ans+=com(coun[i])
for i in range(n):
    m=com(coun[a[i]]-1)
    o=com(coun[a[i]])
    print(ans-o+m)

### FIXED CODE ###

import collections
N=int(input())
lst=input().split()
s=0
dic=collections.Counter(lst)
for i in dic.values():
    s+=(i*i-i)//2
for i in lst:
    print(s+1-dic[i])
def solve():
    N, K = map(int, input().split())
    data = [int(input()) for _ in range(N)]
    data.sort()
    ans = []
    cnt = 0
    while True:
        h_max1 = data[cnt + K - 1]
        h_min1 = data[cnt]
        h_max2 = data[-cnt-1]
        h_min2 = data[-cnt - K]
        tmp1 = h_max1 - h_min1
        tmp2 = h_max2 - h_min2
        ans.append(tmp1)
        ans.append(tmp2)
        cnt = cnt + 1
        if data[cnt] == data[-cnt-K]:
            break

    print(min(ans))


solve()

### FIXED CODE ###


def solve():
    N, K = map(int, input().split())
    data = [int(input()) for _ in range(N)]
    data.sort()
    ans = []
    cnt = 0
    while True:
        if data[cnt] >= data[-cnt-K]:
            break
        h_max1 = data[cnt + K - 1]
        h_min1 = data[cnt]
        h_max2 = data[-cnt-1]
        h_min2 = data[-cnt - K]
        tmp1 = h_max1 - h_min1
        tmp2 = h_max2 - h_min2
        ans.append(tmp1)
        ans.append(tmp2)
        cnt = cnt + 1
        if data[cnt] >= data[-cnt-K]:
            break

    print(min(ans))


solve()
l, r = map(int, input().split())
# m = 2 * (10 ** 9)
# n = 2 * (10 ** 9) + 2
flag = 0
for i in range(l, r+1):
    if i != 0 and i % 2019 == 0:
        flag = 1
        break
#     a = m
#     m = min(m, i % 2019)
#     if a == m:
#         n = min(n, i % 2019)
#     else:
#         n = min(n, a)
#
# print('m', m)
# print('n', n)

if flag != 1:
    if l == 0:
        a = (l+1 % 2019) * (l+2 % 2019) % 2019
    else:
        a = (l % 2019) * (l+1 % 2019) % 2019

if l == 0 and a == 0:
    flag = 2

if flag == 0:
    print(a)
elif flag == 1:
    print(0)
else:
    print(2019)


### FIXED CODE ###

l, r = map(int, input().split())

if (r-1) * r < 2019:
    print(l * (l+1))
elif r - l > 2019:
    print(0)
else:
    ans = 2019
    for i in range(l, r):
        for k in range(i+1, r+1):
            a = ((i % 2019) * (k % 2019)) % 2019
            if a < ans:
                ans = a
    print(ans)
a, b = map(int,input())

if (a + b) < 25:
  print(a + b)

else:
  print(24 - (a + b))
  

### FIXED CODE ###

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

print((a + b) % 24)
N, K = map(int,input().split())
state = [1 for i in range(N)]
for i in range(K):
  d = int(input())
  for j in range(d):
    x = list(map(int,input().split()))
    for k in x:
      state[k-1] = 0
print(sum(state))

### FIXED CODE ###

N, K = map(int,input().split())
state = [1 for i in range(N)]
for i in range(K):
  d = int(input())
  #print(1,i,d)
  x = list(map(int, input().split()))
  for k in x:
    state[k-1] = 0
print(sum(state))
def popcnt_int(n): # n:int
    return bin(n).count('1')

def popcnt_bin(s): # s:str
    return s.count('1')

def poptimes(n, cnt=1): #:int
    if n==0:
        return cnt
    else:
        n %= popcnt_int(n)
        cnt += 1
        return poptimes(n, cnt)

n = int(input())
s = input()

s_int = int(s,2)
pc = popcnt_bin(s)
pc_plus = s_int % (pc+1)
pc_minus = s_int % (pc-1)
#print(n,s,s_int,pc,pc_plus,pc_minus)

for i in range(n):
    if s[i] == '1':
        if pc != 1:
            tmp = pc_minus - pow(2, n-i-1, pc-1)
            print(poptimes(tmp % (pc-1)))
        else:
            print(0)
            continue
    
    else:
        tmp = pc_plus + pow(2, n-i-1, pc+1)
        print(poptimes(tmp % (pc+1)))


### FIXED CODE ###

def popcnt_int(n): # n:int
    return bin(n).count('1')

def popcnt_bin(s): # s:str
    return s.count('1')

def poptimes(n, cnt=1): #:int
    if n==0:
        return cnt
    else:
        n %= popcnt_int(n)
        cnt += 1
        return poptimes(n, cnt)

n = int(input())
s = input()

s_int = int(s,2)
pc = popcnt_bin(s)
pc_plus = s_int % (pc+1)
if  pc != 1:
    pc_minus = s_int % (pc-1)
#print(n,s,s_int,pc,pc_plus,pc_minus)

for i in range(n):
    if s[i] == '1':
        if pc != 1:
            tmp = pc_minus - pow(2, n-i-1, pc-1)
            print(poptimes(tmp % (pc-1)))
        else:
            print(0)
            continue
    
    else:
        tmp = pc_plus + pow(2, n-i-1, pc+1)
        print(poptimes(tmp % (pc+1)))
count = [0 for i in range(26)]
alpha = "abcdefghijklmnopqrstuvwxyz"
while True:
    sentence = input()
    for letter in sentence:
        letter.lower()
        num = 0
        for j in alpha:
            if letter == j:
                count[num] += 1
            else:
                num += 1
num = 0
for k in alpha:
    print(k + " : " + str(count[num]))
    num += 1


### FIXED CODE ###

import sys
s = sys.stdin.read().lower()
count = [0 for i in range(26)]
for j in s:
    num = ord(j) - ord('a')
    if num >= 0 and num <= 25:
        count[num] += 1
for k in range(26):
    print(chr(k + 97) + " : " + str(count[k]))
import sys
sys.setrecursionlimit(10**6)

class UnionFind():
	def __init__(self, n):
		self.size = n
		self.root = [-1 for _ in range(n+1)]
		self.rnk = [0 for _ in range(n+1)]

	def findRoot(self, a):
		if self.root[a] < 0:
			return a
		else:
			return self.findRoot(self.root[a])

	def uniteTree(self, a, b):
		a = self.findRoot(a)
		b = self.findRoot(b)

		if a == b:
			return

		elif self.rnk[a] > self.rnk[b]:
			self.root[a] += self.root[b]
			self.root[b] = a

		elif self.rnk[b] > self.rnk[a]:
			self.root[b] += self.root[a]
			self.root[a] = b

		elif self.rnk[a] == self.rnk[b]:
			self.root[b] += self.rnk[a]
			self.root[a] = b
			self.rnk[b] += 1

	def judgeTree(self, a, b):
		return self.findRoot(a) == self.findRoot(b)

	def count(self, a):
		return self.rnk[self.findRoot(a)] * (-1)



N, M = map(int, input().split())
A = list(map(int, input().split()))
O = [list(map(int, input().split())) for _ in range(M)]

ope = UnionFind(N)

for i in range(M):
	ope.uniteTree(O[i][0], O[i][1])

cnt = 0
for i in range(N):
	if ope.judgeTree(A[i], i+1):
		cnt += 1

print(cnt)

### FIXED CODE ###

class UnionFind():
    # 作りたい要素数nで初期化
    # 使用するインスタンス変数の初期化
    def __init__(self, n):
        self.n = n
        # root[x]<0ならそのノードが根かつその値が木の要素数
        # rootノードでその木の要素数を記録する
        self.root = [-1]*(n+1)
        # 木をくっつける時にアンバランスにならないように調整する
        self.rnk = [0]*(n+1)

    # ノードxのrootノードを見つける
    def Find_Root(self, x):
        if(self.root[x] < 0):
            return x
        else:
            # ここで代入しておくことで、後の繰り返しを避ける
            self.root[x] = self.Find_Root(self.root[x])
            return self.root[x]
    # 木の併合、入力は併合したい各ノード
    def Unite(self, x, y):
        # 入力ノードのrootノードを見つける
        x = self.Find_Root(x)
        y = self.Find_Root(y)
        # すでに同じ木に属していた場合
        if(x == y):
            return 
        # 違う木に属していた場合rnkを見てくっつける方を決める
        elif(self.rnk[x] > self.rnk[y]):
            self.root[x] += self.root[y]
            self.root[y] = x

        else:
            self.root[y] += self.root[x]
            self.root[x] = y
            # rnkが同じ（深さに差がない場合）は1増やす
            if(self.rnk[x] == self.rnk[y]):
                self.rnk[y] += 1
    # xとyが同じグループに属するか判断
    def isSameGroup(self, x, y):
        return self.Find_Root(x) == self.Find_Root(y)

    # ノードxが属する木のサイズを返す
    def Count(self, x):
        return -self.root[self.Find_Root(x)]

N, M = map(int, input().split())
A = list(map(int, input().split()))
O = [list(map(int, input().split())) for _ in range(M)]

ope = UnionFind(N)

for i in range(M):
	ope.Unite(O[i][0], O[i][1])

cnt = 0

for i in range(N):
	if ope.isSameGroup(i+1, A[i]):
		cnt += 1

print(cnt)
S = input()
count = 0
if S[0] == 'R':
  if S[1] == 'R':
    if S[2] == 'R':
      	print(3)
  	else:
    	print(2)
  else:
    if S[2] == 'R':
      print(1)
else:
  if S[1] == 'R':
    if S[2] == 'R':
      print(2)
    else:
      print(1)
  else:
    if S[2] == 'R':
      print(1)
    else:
      print(0)

### FIXED CODE ###

S = input()
if S[0] == 'R':
    if S[1] == 'R':
        if S[2] == 'R':
            print(3)
        else:
            print(2)
    else:
        print(1)
else:
    if S[1] == 'R':
        if S[2] == 'R':
              print(2)
        else:
              print(1)
    else:
        if S[2] == 'R':
              print(1)
        else:
              print(0)
x,y=map(int,input().split())
a=[4,6,9,11]
print('Yes' if x==y==2 or (x in a and y in a) or (x not in a and y not in a))

### FIXED CODE ###

x,y=map(int,input().split())
a=[1,3,5,7,8,10,12]
b=[4,6,9,11]
c=[2]

if (x in a and y in a) or (x in b and y in b) or (x in c and y in c):
    print('Yes')
else:
    print('No')
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

a, b = [0], [0]
for i in range(N):
a.append(a[i] + A[i])
for i in range(M):
b.append(b[i] + B[i])

ans, j = 0, M
for i in range(N + 1):
  if a[i] > K:
    break
  while b[j] > K - a[i]:
      j -= 1
ans = max(ans, i + j)
print(ans)

### FIXED CODE ###

a = int(input())
print(a + a**2 + a**3)
#!/usr/bin/env python3
# coding: utf-8

class Dice() :

    mask = {'N':(1,5,2,3,0,4), 'E':(3,1,0,5,4,2),
            'W':(2,1,5,0,4,3), 'S':(4,0,2,3,5,1),'CW':(0,2,4,1,3,5)}

    way = ("N","E","W","S","CW","Nop")

    def __init__(self, data):
        self.label = data

    def move(self, data):
        if data == "Nop"
            return
        self.label = [self.label[idx] for idx in self.mask[data]]

    def get_up(self):
        return self.label[0]

    def compare_6sq(self, dice2):
        check = True
        for i in range(6):
            if self.label[i] == dice2.label[i] :
                continue
            else:
                check = False
                break

        return check
    
    def compare_4rot(self, dice2):
        ok = False
        for i in range(4):
            self.move("CW")
            if self.compare_6sq(dice2) :
                ok =True
                break
        return ok
    
    def compare(self,dice2)
        ok = False
        orderway =("Nop","E","N","E","N","E")

        for s in orderway:
            self.move(s)
            if self.compare_4rot(dice2):
                ok = True
                break
        
        return ok





dice1 = Dice(input().split())
dice2 = Dice(input().split())

if dice1.compare(dice2) :
    print ("Yes")
else:
    print ("No")



### FIXED CODE ###

#!/usr/bin/env python3
# coding: utf-8
import random


class Dice() :

    mask = {'N':(1,5,2,3,0,4), 'E':(3,1,0,5,4,2),
            'W':(2,1,5,0,4,3), 'S':(4,0,2,3,5,1),'CW':(0,2,4,1,3,5)}

    way = ("N","E","W","S","CW","Nop")

    def __init__(self, data):
        self.label = data

    def move(self, data):
        if data == "Nop":
            return
        self.label = [self.label[idx] for idx in self.mask[data]]

    def get_up(self):
        return self.label[0]

    def compare_6sq(self, dice2):
        check = True
        for i in range(6):
            if self.label[i] == dice2.label[i] :
                continue
            else:
                check = False
                break

        return check
    
    def compare_4rot(self, dice2):
        ok = False
        for i in range(4):
            self.move("CW")
            if self.compare_6sq(dice2) :
                ok =True
                break
        return ok
    
    def compare(self,dice2):
        ok = False
        orderway =("Nop","E","N","E","N","E")

        for s in orderway:
            self.move(s)
            if self.compare_4rot(dice2):
                ok = True
                break
        
        return ok





dice1 = Dice(input().split())
dice2 = Dice(input().split())

if dice1.compare(dice2) :
    print ("Yes")
else:
    print ("No")
n=input()
a=list(input())
result = 0
for num in a:
    result += 1/num
    
print(1/result)



### FIXED CODE ###

n=input()
a=str(input())
li = list(a.split(" "))
result = 0
for num in li:
    result += 1/int(num)
    
print(1/result)
# ABC174 E

n, k = map(int, input().split())
a_l = [int(x) for x in input().split()]

left = 0
right = max(a_l)


def cut(len):
    ret = 0
    for i in range(n):
        if a_l[i] % len == 0:
            ret += a_l[i] // len - 1
        else:
            ret += a_l[i] // len
    return ret


while (right - left) > 1:
    _q = (left + right) // 2
    _ret = cut(_q)
    if k >= _ret:
        right = _q
    else:
        left = _q

_l = cut(left)
_r = cut(right)

if _l <= k:
    print(left)
else:
    print(right)


### FIXED CODE ###

# ABC174 E

n, k = map(int, input().split())
a_l = [int(x) for x in input().split()]

left = 0
right = max(a_l)


def cut(len):
    ret = 0
    for i in range(n):
        if a_l[i] % len == 0:
            ret += a_l[i] // len - 1
        else:
            ret += a_l[i] // len
    return ret


while (right - left) > 1:
    _q = (left + right) // 2
    _ret = cut(_q)
    if k >= _ret:
        right = _q
    else:
        left = _q

print(right)
from sys import stdin

n = stdin.readline().rstrip().split()[0]
A = [int(x) for x in stdin.readline().rstrip().split()]

s = str(int((sum(A)**2 - sum([a**2 for a in A])) / 2))

if(int(s) < (10**9 + 7)):
    print(int(s))

x = int(s[-9:]) - 7 * int(s[:-9])
if(x < 0):
    print(x % (10**9 + 7))
else:
    print(x)

### FIXED CODE ###

import sys
 
stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))
 
 
def main():
    n = ni()
    A = nl()
    mod = 10 ** 9 + 7
    s = sum(A)
    q = sum([a ** 2 for a in A])
    ans = (((s * s) - q)) // 2
    print(int(ans % mod))
 
 
if __name__ == '__main__':
    main()
import math

r = int(input())

s = r*r*math.pi
l = 2*r*math.pi

print(str(s) + " " + str(l))

### FIXED CODE ###

r = float(input())

s = r * r * 3.14159265358979
l = 2 * r * 3.14159265358979
 
print(s, end = " ")
print(l)
def fib(n):
    a, b = 1, 1
    if n == 1:
        return a
    elif n == 2:
        return b
    else:
        for i in range(n-2):
            a, b = b, a + b
        return b

n,m = map(int,input().split())
a = [int(input()) for i in range(m)]
ans = fib(a[0])
for j in range(1,m):
    if m == 1:
        continue
    elif a[j] == a[j-1]:
        ans = 0
    else:
        ans *= fib(a[j]-a[j-1]-1)
ans *= fib(n-a[m-1])
print(ans%1000000007)


### FIXED CODE ###

def fib(n):
    a, b = 1, 1
    if n == 1:
        return a
    elif n == 2:
        return b
    else:
        for i in range(n-2):
            a, b = b, a + b
        return b

n,m = map(int,input().split())
if m != 0:
  a = [int(input()) for i in range(m)]
  ans = fib(a[0])
  for j in range(1,m):
    if m == 1:
        continue
    elif a[j] == a[j-1]+1:
        ans = 0
    else:
        ans *= fib(a[j]-a[j-1]-1)
  ans *= fib(n-a[m-1])
else:
  ans = fib(n+1)
print(ans%1000000007)
a = input()
b = input()
c = input()

if a == b == c:
    print(1)
elif a == b or b == c or a == c:
    print(2)
else:
    print(3)


### FIXED CODE ###

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

if a == b and a == c:
    print(1)
elif a == b or a == c or b == c:
    print(2)
else:
    print(3)
N = int(input())
An = list(map(int, input().split()))
for n in range(N):
    An[n] -= (n+1)

An.sort()

m = N-1
if (m % 2 == 0):
    cent = (An[m//2] + An[m//2 + 1]) // 2
else:
    cent = An[(m+1)//2]

ans = 0
for n in range(N):
    ans += abs(An[n] - cent)

print(ans)



### FIXED CODE ###

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

for n in range(N):
    An[n] -= (n+1)

An.sort()

if (N-1) % 2 != 0:
    m = N//2 - 1
else:
    m = (N-1)//2

bf = -sum(An[0:m+1:]) + (m+1)*An[m]
af = sum(An[m+1::]) - (N-m-1)*An[m]
ans = bf + af
print(ans)
a,b = int(input().split())
print(a*b, (a+b)*2)


### FIXED CODE ###

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

print(a*b,(a+b)*2)
N = int(input())
B = list(map(int,input().split()))
A = []
for i in range(N):
  A.append(0)

for i in range(N):
  if A[i] > B[i]:
    A[i] = B[i]
  if A[i + 1] > B[i]:
    A[i + 1] = B[i]

print(A)

### FIXED CODE ###

N = int(input())
B = list(map(int, input().split()))
ans = B[0]
for i in range(1, N-1):
    ans += min(B[i - 1], B[i])
ans += B[-1]
print(ans)
l = list(map(int,input()split()))
ans = list(dict.fromkeys(l))
print(len(ans)+1)

### FIXED CODE ###

l = list(map(int,input().split()))
ans = list(dict.fromkeys(l))
print(len(ans))
s=str(input());a=["A","K","I","H","A","B","A","R"]
if s=="AKIHABARA":
    print("YES")
elif len(s)<5:
    print("NO")
else:
    s=list(s)
    for i in range(len(a)):
        if s[i]!=a[i]:
           s.insert(i,"A")
        #print(s,a,i)
        if s==a or s==["A","K","I","H","A","B","A","R","A"]:
            print("YES")
            break
        else:
            pass
    else:
         print("NO")

### FIXED CODE ###

s=str(input());a=["A","K","I","H","A","B","A","R"]
if s=="AKIHABARA":
    print("YES")
elif "K" not in s or "I" not in s or "H" not in s or "B" not in s or "R" not in s:
    print("NO")
else:
    s=list(s)
    for i in range(len(a)):
        if s[i]!=a[i]:
           s.insert(i,"A")
        #print(s,a,i)
        if s==a or s==["A","K","I","H","A","B","A","R","A"]:
            print("YES")
            break
        else:
            pass
    else:
         print("NO")
n = int(input())
d = n%10

if d in [2, 4, 5, 7, 9]:
  print("hon")
elif d in [0, 1, 6, 8]:
  print("pon")
else d in [3]:
  print("bon")

### FIXED CODE ###

n = int(input())
d = n%10
 
if d in [2, 4, 5, 7, 9]:
  print("hon")
elif d in [0, 1, 6, 8]:
  print("pon")
elif d in [3]:
  print("bon")
a,b,c = list(map(int, input().split()))

if(math.sqrt(a) + math.sqrt(b) < math.sqrt(c)-0.000001):
    print("Yes")
else:
    print("No")
print(math.sqrt(a) + math.sqrt(b),math.sqrt(c)-0.000001)




### FIXED CODE ###



import decimal
#decimal.getcontext().prec = 30
a,b,c = list(map(int, input().split()))
a = decimal.Decimal(a)
b = decimal.Decimal(b)
c = decimal.Decimal(c)
d = decimal.Decimal(0.5)
e = decimal.Decimal(1/10000000)

#print(a**decimal.Decimal(0.5))

if(a**d + b**d < (c)**d ):
    print("Yes")
else:
    print("No")
#print(a**d + b**d , (c)**d)
import math

N = int(input())

A = list(map(int, input().split()))
a = A[0]
for i in range(1, len(A)):
    a = math.gcd(a, A[i])

print(a)



### FIXED CODE ###

def gcd(a,b): 
    if(b==0): 
        return a 
    else: 
        return gcd(b,a%b)


N = int(input())

A = list(map(int, input().split()))
a = A[0]
for i in range(1, len(A)):
    a = gcd(a, A[i])

print(a)
aaaa

### FIXED CODE ###

c=input()
print(chr(ord(c)+1))
a,b,c,d=map(int,input().split())
arr[a,b,c,d]
if arr.count('1')==1 and arr.count('9')==1 and arr.count('7')==1 and arr.count('4')==1:
  print('YES')
else:
  print('NO')

### FIXED CODE ###

a,b,c,d=map(int,input().split())
arr=[a,b,c,d]
if (arr.count(1)==1 and arr.count(9)==1) and (arr.count(7)==1 and arr.count(4)==1):
  print('YES')
else:
  print('NO')
# -*- coding: utf-8 -*-
S = input()
T = input()
# 出力
print("{}".format(S + T))

### FIXED CODE ###

ST = input("").split()
S, T = ST[0], ST[1]
print("{}".format(T + S))
N = int(input())
d = list(map(int, input().split()))


def combinations(d, tmp_out, i, j):
    if (i >= N):
        return tmp_out
    elif (j >= N):
        i += 1
        j = i + 1
        if (i >= N):
            return tmp_out
        elif (j >= N):
            return tmp_out
    tmp_out += d[i] * d[j]

    return combinations(d, tmp_out, i, j + 1)


out = combinations(d, 0, 0, 1)

print(out)

### FIXED CODE ###

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

out = 0
for i in range(N):
    for j in range(i + 1, N):
        out += d[i] * d[j]

print(out)
n=int(input())
a=26
b=1
import string
array=list(string.ascii_lowercase)
while n>a:
  b+=1
  a+=26**b
if b==1:
  print(array[n+1])
else:
  c=b-1
  d=n-26**c
  for i in range(c-1):
    brray=[0]
    crray=[d]
    brray[i+1]=crray[i]//26**(c-i)
    crray[i+1]=crray[i]%26**(c-i)
  ans=array[brray[1]+1]
  if c>1:
    for j in range(2,c):
      ans=ans+brray[j]
  ans=ans+crray[c]
  print(ans)

### FIXED CODE ###

n=int(input())
a=26
b=1
import math
import string
array=list(string.ascii_lowercase)
while n>a:
  b+=1
  a+=26**b
if b==1:
  print(array[n-1])
else:
  c=b-1
  d=n-a
  brray=[0]
  crray=[d]
  for i in range(c):
    brray.append(math.ceil(crray[i]/(26**(c-i))))
    crray.append(crray[i]%(26**(c-i)))
  ans=array[brray[1]-1]
  if c>1:
    for j in range(2,b):
      ans=ans+array[brray[j]-1]
  ans=ans+array[crray[c]-1]
  print(ans)
import heapq

N, M = map(int, input().split())
works = [[] for _ in range(M+1)]
for _ in range(N):
  day, reward = map(int, input().split())
  works[day].append(reward)
hp = []
ans = 0
for day in range(1, M+1):
  if len(works[day]) > 0:
    for reward in works[day]:
      heapq.heappush(hp, -reward)
  if len(hp) > 0:
    ans += -heapq.heappop(hp)
print(ans)

### FIXED CODE ###

import heapq

MAX = 10**5+1
N, M = map(int, input().split())
works = [[] for _ in range(MAX)]
for _ in range(N):
  day, reward = map(int, input().split())
  works[day].append(reward)
hp = []
ans = 0
for day in range(1, M+1):
  if len(works[day]) > 0:
    for reward in works[day]:
      heapq.heappush(hp, -reward)
  if len(hp) > 0:
    ans += -heapq.heappop(hp)
print(ans)
a, b = map(int,input().split())

a1 =a//0.08
a2 =(a+1)//0.08
b1 = b//0.1
b2= (b+1)//0.1

A=range(a1,a2+1)
B=range(b1,b2+1)

if set(A)&set(B)==set():
  print(-1)
else:
  C = set(A)&set(B)
  print(min(C))

### FIXED CODE ###

a, b = map(int,input().split())
ans = -1
for i in range(10):
    num = 10*b + i
    if a <= num*0.08 < a+1:
        ans = num
        break
print(ans)
a,b,c = map(int(), input().split())
k = int(input())

m = max(a,b,c)
al = a+b+c-m+m*2**k
print(al)

### FIXED CODE ###

a,b,c = map(int, input().split())
k = int(input())
kk=2**k
m = max(a,b,c)
al = a+b+c-m+m*kk
print(al)