Harryxun/stf_run huggingface dataset:
N=int(input())
S=set()

for i in range(N):
  s=input()
  if s[0] in [M,A,R,C,H]:
    S.add(s)

L=len(S)

print(L*(L-1)*(L-2)//6)

### FIXED CODE ###

N=int(input())
chars=['M','A','R','C','H']
dict={}
for c in chars:
  dict[c]=0
  
ans=0
  
for i in range(N):
  s=input()
  if (s[0] in chars):
    dict[s[0]]+=1

L=list(dict.values())
    
for i in range(2**5):
  usedchars=[]
  for j in range(5):
    if i>>j&1==1:
      usedchars.append(L[j])
    
  if len(usedchars)==3:
    ans+=usedchars[0]*usedchars[1]*usedchars[2]

print(ans)
import.math
A, B, H, M = map(int, input.split())
sita = (H*30+M*0.5)-(M*6)
if (sita > 180):
  Sita = 360 - sita
elif (0 > sita >= -180):
  Sita = sita * -1
elif (-180 > sita > -360):
  Sita = sita + 360
else:
  Sita = sita
print((A**2+B**2-2*A*B*(math.cos(Sita)))**0.5)

### FIXED CODE ###

def resolve():
    import math
    A, B, H, M = map(int, input().split())
    sita = abs(H*30+M*0.5-M*6)
    if sita > 180:
        sita = 360 - sita
    print(math.sqrt(A**2+B**2-2*A*B*math.cos(math.radians(sita))))
resolve()
a, b = input()
a = int(a)
b = int(b)

print(a*b)

### FIXED CODE ###

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

print(a*b)
n , m = map(int,input().split())
arr = list(map(int,input().split()))
add = sum(arr)
miniVotes = int(add*(1/(4*m)))
cnt = 0
for i in range(len(arr)):
	if arr[i]>=miniVotes:
		cnt+=1
if(cnt>=m):
	print("Yes")
else:
	print("No")

### FIXED CODE ###

x ,y ,z = map(int,input().split())
print(z,x,y)
n=input()
n=int(n)
val=list(map(int,input().strip().split(' ')))
val.sort()
res=0
if val:
    if len(val)==1:
        print(val[0]/2)
    elif len(val)==2:
        print(sun(val)/2)
    else:
        #res=(val[0]+val[1])/2
        res=(val[0]+val[1])/2
        for i in range(2,len(val)):
            res=(res+val[i])/2
            #print(res)
        print(res)
else:
    #print('error')
    pass

### FIXED CODE ###

n=input().strip()
n=int(n)
if n>=2 and n<=50:
    num=list(map(int,input().strip().split()))
num.sort()

if n==2:
    print(sum(num)/2)
else:
    num.append((num[0]+num[1])/2)
    num=num[2:]
    for i in range(len(num)-1):
        num.append((num[-1]+num[0])/2)
        num=num[1:]
    print(num[-1])
n, m = map(int, input().split())
x = [-1] * n

exist = True

if n == 1:
    sc_list = []
    for i in range(m):
        sc_list.append(list(map(int, input().split())))
    if m >= 2:
        for j in range(m-1):
            if sc_list[j][1] != sc_list[j+1][1]:
                exist = False
    if exist:
        x = str(sc_list[0][1])

elif n >= 2:
    for i in range(m):
        s, c = map(int, input().split())
        if s == 1:
            if c == 0:
                exist = False
            else:
                if x[0] != -1 and x[0] != c:
                    exist = False
                else:
                    x[0] = c
        else:
            if x[s-1] != -1 and x[s-1] != c:
                exist = False
            else:
                x[s-1] = c

    if x[0] == -1:
        exist = False
    if exist:
        x = [0 if j == -1 else j for j in x]
        x = "".join(map(str,x))
            
if exist:
    print(x)
else:
    print(-1)


### FIXED CODE ###

n, m = map(int, input().split())

exist = True

if n == 1:
    sc_list = []
    for i in range(m):
        sc_list.append(list(map(int, input().split())))
    
    if m >= 2:
        for j in range(m-1):
            if sc_list[j][1] != sc_list[j+1][1]:
                exist = False
    
    if exist:
        if m >= 1:
            x = str(sc_list[0][1])
        elif m == 0:
            x = '0'

elif n >= 2:
    x = [-1] * n

    for i in range(m):
        s, c = map(int, input().split())
        if s == 1:
            if c == 0:
                exist = False
            else:
                if x[0] != -1 and x[0] != c:
                    exist = False
                else:
                    x[0] = c
        else:
            if x[s-1] != -1 and x[s-1] != c:
                exist = False
            else:
                x[s-1] = c

    if x[0] == -1 :
        x[0] = 1
    if exist:
        x = [0 if j == -1 else j for j in x]
        x = "".join(map(str,x))
            
if exist:
    print(x)
else:
    print('-1')
S = input()

flag = 1
if S[0] == 'A':
  c_count = 0
  for i in range(1,len(S)):
    if 2 <= i <= len(S)-2:
      if S[i] == 'C':
        c_count += 1
    else:
      if S[i].islower() == False:
        flag = 0
else:
  flag = 0
if c_count == 1 and flag == 1:
  print('AC')
else:
  print('WA')

### FIXED CODE ###

S = input()

flag = 1
c_count = 0
if S[0] == 'A':
  for i in range(1,len(S)):
    if 2 <= i <= len(S)-2:
      if S[i] == 'C':
        c_count += 1
    else:
      if S[i].islower() == False:
        flag = 0
else:
  flag = 0
if c_count == 1 and flag == 1:
  print('AC')
else:
  print('WA')
N = int(input())
arr = map(int, input().split(' '))
ans = [0 for x in range(N)]
for i in reversed(range(N))
	if (i+1) > N/2.0:
    	ans[i] = arr[i]
    else:
      sum_v = 0
      for k in range(N//(i+1)):
        index = (k+1) * (i+1)
        sum_v += ans[index]
      if sum_v % 2 == arr[i]:
        ans[i] = 0
      else:
		ans[i] = 1
ans_arr = []
for i in ans:
  if ans == 1:
    ans_arr.append(i)

print(sum(ans))
print(' '.join(ans_arr))


### FIXED CODE ###

def main():
    n = int(input())
    A = [0] + list(map(int, input().rstrip().split()))
    for i in range(n // 2, 0, -1):  # second half: no multiples
        A[i] = sum(A[i::i]) % 2
    ans = [i for i, j in enumerate(A) if j]
    print(len(ans))  # all cells: [1] -> len() (much faster than sum())
    print(*ans)


if __name__ == "__main__":
    main()
s = input()
k = int(input())

if s[0] == '1':
    print(s[1])
else:
    print(s[0])


### FIXED CODE ###


s = input()
k = int(input())

# 1の連続性を確認し終わった段階の数字を記録
cnt = 1

if len(s) == 1:
    print(s)
    exit()

for i in range(len(s)-1):
    if s[i] != '1':
        num = s[i]
        break
    if s[i] == s[i+1] == '1':
        cnt += 1

if cnt >= k:
    print(1)
else:
    print(num)
x,y=map(int, raw_input().split())
if 0<=x and 0<=y:
    if x<=y:
        print abs(x-y)
    else:
        print min(2+abs(x-y),1+abs(x+y))
elif x<0 and y<0:
    if x<=y:
        print min(abs(x-y),1+abs(x-y*-1)
    else:
        print min(2+abs(x-y), 1+abs(x-y*-1))
elif x<0 and 0<=y:
    if x*-1<=y:
        print min(1+abs(y-x*-1),1+abs(x-y*-1))
    else:
       print min(abs(x-y),1+abs(x-y*-1))
elif y<0 and 0<=x:
    if y*-1<x:
        print min(abs(x-y),1+abs(x*-1-y))
    else:
        print min(abs(x-y),1+abs(x-y*-1))


### FIXED CODE ###

x,y=map(int, raw_input().split())
if 0<=x and 0<=y:
    if x<=y:
        print abs(x-y)
    else:
        print min(1+abs(x*-1-y),2+abs(x-y))
elif x<0 and y<0:
    if x<=y:
        print abs(x-y)
    else:
        print min(2+abs(x-y), 1+abs(x-y*-1))
elif x<0 and y==0:
    print abs(x-y)
elif x<0 and 0<y:
    if x*-1<=y:
        print 1+abs(y-x*-1)
    else:
        print 1+abs(x*-1-y)
elif y<0 and x==0:
    print 1+abs(x-y)
elif y<0 and 0<x:
        print 1+abs(x*-1-y)
n = input()
n_l = int(n[1:])
if n_l==0:
    print(0)
else:
    print(1000-n_l)

### FIXED CODE ###

n = input()
n_l = int(n[-3:])
if n_l==0:
    print(0)
else:
    print(1000-n_l)
a,b = map(int,input().split())
ans = max(a,b)
if min(a,b)>max(a.b)-1:
  ans+=min(a,b)
else:
  ans+=max(a,b)-1
print(ans)  


### FIXED CODE ###

a,b = map(int,input().split())
ans = max(a,b)
if min(a,b)>max(a,b)-1:
  ans+=min(a,b)
else:
  ans+=max(a,b)-1
print(ans)
in_s = input().rstrip()
lst = list(in_s)
cur=0
while True:
    if cur >= len(lst):
        break
    if lst[cur]!=lst[cur+1]:
        del lst[cur+1]
        del lst[cur]
        cur = max(0,cur-1)
    else:
        cur+=1

print(len(in_s) - len(lst))

### FIXED CODE ###

in_s = input().rstrip()
lst = list(in_s)
cur=0
while True:
    if cur+1 >= len(lst):
        break
    if lst[cur]!=lst[cur+1]:
        del lst[cur+1]
        del lst[cur]
        cur = max(0,cur-1)
    else:
        cur+=1
 
print(len(in_s) - len(lst))
from numpy import*
from itertools import*
n=int(input())
s=input()
t=s.count("#")
r=s.count(".")

l=[t,r]
x=[len(list(v))for k,v in groupby(s)if k=="#"]
y=[len(list(v))for k,v in groupby(s)if k=="."]
if len(x)>len(y):
    y=[0]+y
elif len(x)<len(y):
    x=[0]+x
else:
    y=y+[0]
    x=[0]+x

x=array([0]+list(accumulate(x)))
y=array(list(accumulate(y[::-1]))[::-1]+[0])
print(min(x+y))


### FIXED CODE ###

a,b,c=map(int,input().split())
if a<c<b or b<c<a:
    print("Yes")
else:
    print("No")
import math
import sys
import bisect

N, M = [int(x) for x in input().split()]
A = [None] * M
B = [None] * M
AB = [[0] * N for _ in range(N)]

for i in range(M):
    a,b = [int(x) for x in input().split()]
    A[i] = a - 1
    B[i] = b - 1
    AB[a - 1][b - 1] = 1
    AB[b - 1][a - 1] = 1

def isRenketsu(MAT):
    openNode = {0}
    reachableNode = {0}

    while(len(openNode) != 0):
        n = openNode.pop()
        for i in range(M):
            if MAT[n][i] == 1:
                if i in reachableNode:
                    pass
                else:
                    openNode.add(i)
                    reachableNode.add(i)
    return len(reachableNode) == N


ret = 0
for i in range(M):
    AB[A[i]][B[i]] = 0
    AB[B[i]][A[i]] = 0
    if isRenketsu(AB) == False:
        ret += 1
    AB[A[i]][B[i]] = 1
    AB[B[i]][A[i]] = 1

print(ret)



### FIXED CODE ###

class Graph:
    def __init__(self):
        self.g = {}
        self.node = set()

    def addEdge_single(self, x, y, w):
        self.g[(x, y)] = w
        self.node.add(x)
        self.node.add(y)

    def addEdge(self, x, y, w):
        self.addEdge_single(x, y, w)
        self.addEdge_single(y, x, w)

    def dijkstra(self, start):
        open = {start: 0}
        closed = {}
        prev = {start: -1}
        while len(open) > 0:
            x = Graph.select_min(open)
            m = open[x]
            del open[x]
            closed[x] = m
            for (y, w) in self.edge(x):
                if y in open:
                    if open[y] > m + w:
                        open[y] = m + w
                        prev[y] = x
                elif y not in closed:
                    open[y] = m + w
                    prev[y] = x
            # print("open:  {}".format(open))
            # print("closed:{}".format(closed))
            # print("prev:  {}".format(prev))
            # print("-----")
        return closed, prev

    @staticmethod
    def select_min(S):
        m = -1
        for a in S:
            if m == -1 or m > S[a]:
                x = a
                m = S[a]
        return x

    def edge(self, x):
        G = self.g
        return [(b, G[(a, b)]) for (a, b) in G if a == x]


N, M = [int(x) for x in input().split()]

AB = []
for _ in range(M):
    a, b = [int(x) for x in input().split()]
    AB.append((a, b))

ans = 0
for i in range(M):
    g = Graph()
    for j in range(M):
        if i != j:
            g.addEdge(AB[j][0], AB[j][1], 1)
    w, p = g.dijkstra(1)
    if len(w) != N:
        ans += 1
    # print("w:{}, len:{}".format(w, len(w)))

print(ans)
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 28 16:53:54 2019

@author: またの
"""

N,M = map(int,input().split())
L = []
for i in range(N):
    L.append(list(map(int,input().split())))
print(L)

K1=[]
K2=[]
K3=[]
K4=[]
K5=[]
K6=[]
K7=[]
K8=[]

C = [0,0,0,0,0,0,0,0]

for i in range(N):
    K1.append(L[i][0]+L[i][1]+L[i][2])
K1.sort()

for i in range(N):
    K2.append(L[i][0]-L[i][1]+L[i][2])
K2.sort()

for i in range(N):
    K3.append(L[i][0]+L[i][1]-L[i][2])
K3.sort()

for i in range(N):
    K4.append(-L[i][0]+L[i][1]+L[i][2])
K4.sort()

for i in range(N):
    K5.append(-L[i][0]+L[i][1]-L[i][2])
K5.sort()

for i in range(N):
    K6.append(L[i][0]-L[i][1]-L[i][2])
K6.sort()

for i in range(N):
    K7.append(-L[i][0]-L[i][1]+L[i][2])
K7.sort()

for i in range(N):
    K8.append(-L[i][0]-L[i][1]-L[i][2])
K8.sort()

for i in range(M):
    C[0] += K1[M-i]
    C[1] += K2[M-i]
    C[2] += K3[M-i]
    C[3] += K4[M-i]
    C[4] += K5[M-i]
    C[5] += K6[M-i]
    C[6] += K7[M-i]
    C[7] += K8[M-i]
print(max(C))


### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Thu Feb 28 16:53:54 2019

@author: またの
"""

N,M=map(int,input().split())
L = []
for i in range(N):
    L.append(list(map(int,input().split())))

K1=[]
K2=[]
K3=[]
K4=[]
K5=[]
K6=[]
K7=[]
K8=[]

C = [0,0,0,0,0,0,0,0]

for i in range(N):
    K1.append(L[i][0]+L[i][1]+L[i][2])
K1.sort()

for i in range(N):
    K2.append(L[i][0]-L[i][1]+L[i][2])
K2.sort()

for i in range(N):
    K3.append(L[i][0]+L[i][1]-L[i][2])
K3.sort()

for i in range(N):
    K4.append(-L[i][0]+L[i][1]+L[i][2])
K4.sort()

for i in range(N):
    K5.append(-L[i][0]+L[i][1]-L[i][2])
K5.sort()

for i in range(N):
    K6.append(L[i][0]-L[i][1]-L[i][2])
K6.sort()

for i in range(N):
    K7.append(-L[i][0]-L[i][1]+L[i][2])
K7.sort()

for i in range(N):
    K8.append(-L[i][0]-L[i][1]-L[i][2])
K8.sort()

for i in range(M):
    C[0] += K1[N-i-1]
    C[1] += K2[N-i-1]
    C[2] += K3[N-i-1]
    C[3] += K4[N-i-1]
    C[4] += K5[N-i-1]
    C[5] += K6[N-i-1]
    C[6] += K7[N-i-1]
    C[7] += K8[N-i-1]
    
for i in range(8):
    C[i] = abs(C[i])
print(max(C))
import sys
for inp sys.stdin:
    msg = ""
    for i in range(len(inp)):
        if inp[i] == "@": msg += inp[i+2]*int(inp[i+1])
        else: msg += inp[i]
    print msg

### FIXED CODE ###

while True:
    try:
        inp = raw_input()
        i, msg = 0, ""
        while i < len(inp):
            if inp[i] == "@":
                msg += inp[i+2]*int(inp[i+1])
                i += 3
            else:
                msg += inp[i]
                i += 1
        print msg
    except:
        break
D = int(input())

if D==22:
    (print) "Christmas Eve Eve Eve Eve"

if D==23:
    (print) "Christmas Eve Eve"

if D==24:
    (print) "Christmas Eve"

if D==25:
    (print) "Christmas "


### FIXED CODE ###

D = int(input())

if D==22:
    print ("Christmas Eve Eve Eve")

if D==23:
    print ("Christmas Eve Eve")

if D==24:
    print ("Christmas Eve")

if D==25:
    print ("Christmas ")
def qqq(n):

    a = int(n/100)
    if a == 7: 
        return "Yes" 
    
    n %= 100
    b = int(n/10)
    if b == 7:
        return "Yes"
    
    n %= 10
    if n == 7:
        return "Yes"

    return "No"

if __name__ == '__main__':
    N = int(input())
    print qqq(N)

### FIXED CODE ###

def qqq(n):

    a = int(n/100)
    if a == 7: 
        return "Yes" 
    
    n %= 100
    b = int(n/10)
    if b == 7:
        return "Yes"
    
    n %= 10
    if n == 7:
        return "Yes"

    return "No"

if __name__ == '__main__':
    N = int(raw_input())
    print qqq(N)
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

orders = [A, B, C, D, E]
max_fp = 10
ans = 0

for i, order in enumerate(orders):
    if order % 10 < max_fp and order % 10 != 0:
        max_fp = order % 10
        last_order = i

for i, order in enumerate(orders):
    if i == last_order or order % 10 == 0:
        ans += order
    else:
        ans += (order // 10 + 1) * 10

print(ans)


### FIXED CODE ###

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

orders = [A, B, C, D, E]
max_fp = 10
ans = 0
last_order = 0

for i, order in enumerate(orders):
    if order % 10 < max_fp and order % 10 != 0:
        max_fp = order % 10
        last_order = i

for i, order in enumerate(orders):
    if i == last_order or order % 10 == 0:
        ans += order
    else:
        ans += (order // 10 + 1) * 10

print(ans)
import scipy as sp


def divisor(num):
    list = set()
    for i in sp.arange(1, num+1):
        if num % i == 0:
            list.add(i)
    return list


a, b, k = [int(i) for i in input().split()]

div_a = divisor(a)
div_b = divisor(b)

cd = sp.sort(list(div_a & div_b))
cd_r = cd[::-1]
print(cd_r[k-1])


### FIXED CODE ###

a, b, c = [int(i) for i in input().split()]

if b//a > c:
    print(c)
else:
    print(b//a)
a = input()
if a == ABC:
  print('ARC')
else:
  print('ABC')

### FIXED CODE ###

a = input()
if a == 'ABC':
  print('ARC')
else:
  print('ABC')
n, m = map(int, input().split())
is_ac = [False] * 10050
numok = 0
numwa = 0
for i in range(m):
    p, s = input().split()
    p = int(p)
    if is_ac[p]: # すでに正解
        continue
    else: # 未正解
        if s == "AC":
            numok += 1
            is_ac[p] = True
        else:
            numwa += 1
print("{0} {1}".format(numok, numwa))

### FIXED CODE ###

n, m = map(int, input().split())
is_ac = [False] * 200050
count_wa = [0] * 100050
numok = 0
numwa = 0
for i in range(m):
    p, s = input().split()
    p = int(p)
    if is_ac[p]: # すでに正解
        continue
    else: # 未正解
        if s == "AC":
            numok += 1
            is_ac[p] = True
        else:
            count_wa[p] += 1
for i in range(100040):
    if is_ac[i]:
        numwa += count_wa[i]
print("{0} {1}".format(numok, numwa))
import sys
sys.setrecursionlimit(10*9)

def dfs(now):
    for to,dis in G[now]:
        if color[to] == -1:
            color[to] = (color[now] + dis) % 2
            dfs(to)

N = int(input())
G = [[] for _ in range(N)]
color = [-1] * N
color[0] = 1 #偶数=1

for i in range(N-1):
    a,b,c = map(int,input().split())
    a -= 1
    b -= 1
    G[a].append([b,c%2])
    G[b].append([a,c%2])

#print(G)    
dfs(0)
print(*color,sep="\n")

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)

def dfs(now):
    for to,dis in G[now]:
        if color[to] == -1:
            color[to] = (color[now] + dis) % 2
            dfs(to)

N = int(input())
G = [[] for _ in range(N)]
color = [-1] * N
color[0] = 0 #偶数=0

for i in range(N-1):
    a,b,c = map(int,input().split())
    a -= 1
    b -= 1
    G[a].append([b,c%2])
    G[b].append([a,c%2])

#print(G)    
dfs(0)
print(*color,sep="\n")
i=lambda:map(int,input().split());N,T=i();print(min([c for c,t in[i()for _ in[0]*N]if t<=T],default='TLE'))

### FIXED CODE ###

i=lambda:map(int,input().split())
N,T=i()
a=9999
for _ in[0]*N:
  c,t=i()
  a=[min(a,c),a][t>T]
print('TLE'*(a>1000)or a)
K = input()

print((K+1)//2 * K//2)

### FIXED CODE ###

K = int(input())
print(((K+1)//2) * (K//2))
n = int(input())
a = list(map(int, input().split()))

cnt = [0]*10**5+5
for i in a:
    cnt[i] += 1

ans = 0
for i in range(1, 10**5+3):
    ans = max(ans, sum(cnt[i-1:i+2]))
print(ans)

### FIXED CODE ###

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

cnt = [0]*(10**5+5)
for i in a:
    cnt[i] += 1

ans = 0
for i in range(1, 10**5+3):
    ans = max(ans, sum(cnt[i-1:i+2]))
print(ans)
i = 1

x=int(input())
if x==0:
 break
print("case {0}: {1}".format(i,x))
i=+1

### FIXED CODE ###

i = 1

while True:

 x=int(input())
 if x==0:
  break
 print("Case {0}: {1}".format(i,x))
 i+=1
# -*- coding: utf-8 -*-

n=int(input())
l=list(map(int,input().split()))
sl=l[:]
sl.sort()
a=sl[n//2-1]
b=sl[n//2]
for i in l:
  if i<=a:
    print(b)
  else:
    print(a)


### FIXED CODE ###


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

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

if a <= x <= a + b:
    print("YES")
else:
    print("NO")
n,k = map(int,input().split())
MOD = 10**9+7

history = {}
def comb(n,k):
  if (n,k) in history:
    return history((n,k))
  res = 1
  for i in range(k):
    res *= n-i
    res *= pow(i+1,MOD-2,MOD)
  res = res % MOD
  history[(n,k)] = res
  history[(n,n-k)] = res
  return res

for i in range(k):
  #print(comb(k-1,i),comb(n-k+1,i+1))
  ans = comb(k-1,i) * comb(n-k+1,i+1)
  print(ans % MOD)

### FIXED CODE ###

n,k = map(int,input().split())
MOD = 10**9+7

history = {}
def comb(n,k):
  if (n,k) in history:
    return history[(n,k)]
  if k == 0:
    return 1
  res = (n-k+1)*pow(k,MOD-2,MOD)*comb(n,k-1)
  res = res%MOD
  history[(n,k)] = res
  history[(n,n-k)] = res
  return res

for i in range(k):
  #print(comb(k-1,i),comb(n-k+1,i+1))
  ans = comb(k-1,i) * comb(n-k+1,i+1)
  print(ans % MOD)
A = int(input())
B = int(input())
C = int(input())
X = int(input())
r = 0;
for a in range(0, A + 1):
    for b in range(0, B + 1):
        for c in range(0, C + 1):
            if (500 * a + 100 * b + 50 * c == X):
                r += 1
print(r)


### FIXED CODE ###

X = int(input())
A = int(input())
B = int(input())
r = X-A
r -= r//B*B
print(r)
n=int(input())
y=int(input())
a=-1
b=-1
c=-1
for i in range(n+1):
  for j in range(n+1):
    for k in range(n+1):
      if n==i+j+k and 10000*i+5000*j+1000*k==y:
        a=i
        b=j
        c=k
        break

print(a b c)        

### FIXED CODE ###

n, y = (int(i) for i in input().split())  
a=-1
b=-1
c=-1
for i in range(n+1):
  for j in range(n-i+1):
      if 10000*i+5000*j+1000*(n-i-j)==y:
        a=i
        b=j
        c=n-i-j
        break

print(a ,b ,c)
x,y = map(int, input().split())
a=0
b=0
if x=="A":
  a=10
elif x=="B":
  a=11
elif x=="C":
  a=12
elif x=="D":
  a=13
elif x=="E":
  a=14
elif x=="F":
  a=15
  
  
if y=="A":
  b=10
elif y=="B":
  b=11
elif x=="C":
  b=12
elif x=="D":
  b=13
elif x=="E":
  b=14
elif x=="F":
  b=15

if a<b:
  print("<")
elif a>b:
  print(">")
elif a==b:
  print("=")


### FIXED CODE ###

x,y = map(str, input().split())
a=0
b=0
if x=="A":
  a=10
elif x=="B":
  a=11
elif x=="C":
  a=12
elif x=="D":
  a=13
elif x=="E":
  a=14
elif x=="F":
  a=15
  
  
if y=="A":
  b=10
elif y=="B":
  b=11
elif y=="C":
  b=12
elif y=="D":
  b=13
elif y=="E":
  b=14
elif y=="F":
  b=15

if a<b:
  print("<")
elif a>b:
  print(">")
elif a==b:
  print("=")
X = int(input())

import sympy
x = sympy.Symbol('x')

def make_div(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors

for i in make_div(X):
  sol = sympy.solve(x**5 - (x-i)**5 - 33)[0]
  if sympy.im(sol) == 0:
    print(sol, sol - i)
  else:
    continue

### FIXED CODE ###


X = int(input())

def make_div(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors

def f(x, y):
  return x**5 - y**5 - X

Flag = True

for A in range(-1000, 1000):
  if Flag:
    for i in make_div(X):
      B = A - i
      if f(A, B) == 0:
        print(A, B)
        Flag = False
        break
  else:
    break
N, M = [int(nm) for nm in input().split()]
if M != 0:
  a = int(input())
  M -= 1

C = [1, 0] # [-2段目, -1段目]
C += [0]*(N+10) # C = [-2段目, -1段目, 0段目, 1段目, 2段目, ...]
for n in range(0, N+1):
  if n != a or M == 0:
    C[n+2] = (C[n] + C[n+1]) % 1000000007
  else: # n == a and M != 0:
    C[n+2] = 0
    a = int(input())
    M -= 1

ans = C[N+2]  % 1000000007
print(ans)

### FIXED CODE ###

N, M = [int(nm) for nm in input().split()]
if M != 0:
  a = int(input())

C = [1, 0] # [-2段目, -1段目]
C += [0]*(N+10) # C = [-2段目, -1段目, 0段目, 1段目, 2段目, ...]
for n in range(0, N+1):
  if M == 0:
    C[n+2] = (C[n] + C[n+1]) % 1000000007
  else: # M > 0:
    if n != a:
      C[n+2] = (C[n] + C[n+1]) % 1000000007
    else: # n == a:
      C[n+2] = 0
      M -= 1
      if M > 0:
        a = int(input())

ans = C[N+2]  % 1000000007
print(ans)