Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

num = int(input())
data = []
for _ in range(num):
    data.append(sorted(input()))
count = 0
for i in range(num):
    tmp = data[i]
    for j in range(i+1,num):
        if tmp == data[j]:
            count+=1
print(count)

### FIXED CODE ###

"""
N = list(map(int,input().split()))
S = [str(input()) for _ in range(N)]
S = [list(map(int,list(input()))) for _ in range(h)] 
print(*S,sep="")
"""

import sys
sys.setrecursionlimit(10**6)
input = lambda: sys.stdin.readline().rstrip()
inf = float("inf") # 無限

n = int(input())

data = {}
for _ in range(n):
    temp = "".join(sorted(input()))
    # print(temp)
    if temp in data.keys():
        data[temp] += 1
    else:
        data[temp] = 1
# print(data)

answer = 0
for num in data.values():
    answer += (num*(num-1))//2
print(answer)
### BUGGY CODE ###

N, K = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
#%%
temp1 = 1
T = A[0: K]
for i in T:
    temp1 *= i

temp2 = temp1

for i in range(K, N):
    temp2 /= A[i - K]
    temp2 *= A[i]
    if temp1 < temp2:
        print("Yes")
    else:
        print("No")
    temp1 = temp2


### FIXED CODE ###


N, K = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]

#%%

for i in range(K, N):
    if A[i - K] < A[i]:
        print("Yes")
    else:
        print("No")
### BUGGY CODE ###

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

def comb(n, r):
    return math.factorial(n) // math.factorial(n - r)

maxi = 0
for i in range(1, n):
    key = a[i] // 2
    ok = n
    ng = -1
    while abs(ok - ng) > 1:
        mid = (ok + ng) // 2
        if key <= a[mid]: ok = mid
        else: ng = mid
    if ok < i: 
        if comb(a[i], a[ok]) > maxi:
            maxi = comb(a[i], a[ok])
            ans = [a[i], a[ok]]
    if ng >= 0: 
        if comb(a[i], a[ng]) > maxi:
            maxi = comb(a[i], a[ng])
            ans = [a[i], a[ng]]
print("{} {}". format(ans[0], ans[1]))

### FIXED CODE ###

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

def comb(n, r):
    return math.factorial(n) // math.factorial(n - r)

maxi = 0
i = -1
key = a[i] // 2
for j in range(n):
    if a[j] > key:
        break
# print(j, n-1)
# print(j, key, a)
if abs(a[j-1] - key) >= abs(a[j] - key) and j < n-1:
    ans = [a[i], a[j]]
else:
    ans = [a[i], a[j-1]]
# ok = n
# ng = -1
# while abs(ok - ng) > 1:
#     mid = (ok + ng) // 2
#     if key <= a[mid]: ok = mid
#     else: ng = mid
# if ok < i: 
#     if comb(a[i], a[ok]) > maxi:
#         maxi = comb(a[i], a[ok])
#         ans = [a[i], a[ok]]
# if ng >= 0: 
#     if comb(a[i], a[ng]) > maxi:
#         maxi = comb(a[i], a[ng])
#         ans = [a[i], a[ng]]
print("{} {}". format(ans[0], ans[1]))
### BUGGY CODE ###

from collections import defaultdict

d = defaultdict(int)
for _ in range(int(input())):
    d[input()] += 1
print('\n'.join(sorted([k for k in d.keys() if d[k] == max(d.values())])))

### FIXED CODE ###

from collections import defaultdict

d = defaultdict(int)
for _ in range(int(input())):
    d[input()] += 1
mx = max(d.values())
print('\n'.join(sorted([k for k in d.keys() if d[k] == mx])))
### BUGGY CODE ###

n = int(input())
s = []
for i in range(n):
    s.append(str(input()))
    s[i] = sorted(s[i])
r = []
g = []
for i in range(n):
    if(s[i] in r):
        g[r.index(s[i])] += 1
    else:
        r.append(s[i])
        g.append(1)
ans = 0
for i in range(len(g)):
    ans += max(((g[i])*(g[i]-1))//2,0)
print(ans)

### FIXED CODE ###

n = int(input())
s = [str(input()) for _ in range(n)]
e = []
for i in range(n):
    e.append("".join(sorted(s[i])))
e.sort()
g = [1]
for i in range(n-1):
    if e[i] != e[i+1]:
        g.append(1)
    else:
        g[-1] += 1
ans = 0
for i in g:
    ans += (i*(i-1)//2)
print(ans)
### BUGGY CODE ###

def main():
    from bisect import bisect_left
    from array import array
    I=10**9+1
    n,*t=open(0)
    n,q=map(int,n.split())
    *d,=map(int,t[n:])
    z=[]
    for t in t[:n]:
        s,t,x=map(int,t.split())
        z.append((x,bisect_left(d,s-x),bisect_left(d,t-x)))
    N0=2**(q-1).bit_length()
    data=array('I',[I]*2*N0)
    for x,l,r in sorted(z)[::-1]:
        L,R=l+N0,r+N0
        while L<R:
            if R&1:
                R-=1
                data[R-1]=x
            if L&1:
                data[L-1]=x
                L+=1
            L>>=1
            R>>=1
    for k in range(q):
        k+=N0-1
        s=I
        while k+1:
            if data[k]<s:s=data[k]
            k=(k-1)//2
        print(-(s==I)or s)
if __name__=='__main__':
    main()

### FIXED CODE ###

def main():
    from bisect import bisect_left
    def update(l,r,v):
        L,R=l+N0,r+N0
        while L<R:
            if R&1:
                R-=1
                data[R-1]=v
            if L&1:
                data[L-1]=v
                L+=1
            L>>=1
            R>>=1
    def query(k):
        k+=N0-1
        s=10**18
        while k+1:
            if data[k]<s:s=data[k]
            k=~-k//2
        return s
    n,*t=open(0)
    n,q=map(int,n.split())
    d=[-10**18]+list(map(int,t[n:]))+[10**18]
    N0=2**(q+1).bit_length()
    data=[10**18]*2*N0
    for x,t,s in sorted(list(map(int,t.split()))[::-1]for t in t[:n])[::-1]:
        l=bisect_left(d,s-x)
        r=bisect_left(d,t-x)
        update(l,r,x)
    for i in range(q):
        a=query(i+1)
        print(-(a==10**18)or a)
if __name__=='__main__':
    main()
### BUGGY CODE ###

import bisect
import itertools

def binary_search(left, right, search, List):
    while right-left > 1:
        mid = (left+right)//2
        if List[mid] == search:
            return mid
        else:
            if search > List[mid]:
                left = mid
            else:
                right = mid
    return -1


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

d = {"R": [], "G": [], "B": []}

for i in range(n):
    d[s[i]].append(i)

p=list(itertools.permutations(["R","G","B"]))

ans = 0
for a,b,c in p:
    for r in range(len(d[a])):
        second = bisect.bisect_left(d[b], d[a][r])
        for g in range(second, len(d[b])):
            third = bisect.bisect_left(d[c], d[b][g])
            ans += len(d[c])-third
            if binary_search(-1,len(d[c]),2*d[b][g]-d[a][r],d[c])!=-1:
                ans-=1

print(ans)


### FIXED CODE ###

n = int(input())
s = input()
r=0
g=0
b=0
for i in range(n):
    if s[i]=="R":
        r+=1
    elif s[i]=="B":
        b+=1
    else:
        g+=1
ans=r*b*g

for i in range(n):
    for g in range(i+1,n):
        if s[i]!=s[g] and 2*g-i<n:
            if s[2*g-i]!=s[i] and s[2*g-i]!=s[g]:
                ans-=1

print(ans)
### BUGGY CODE ###

n = int(input())
s = input().split()
q = int(input())
t = input().split()
c = 0
s = list(map(int,s))
t = list(map(int,t))

for i in t:
    l = 0
    r = n-1
    cen = int((l+r) / 2)
    while r >= l :
#        print("0:",i,l,r,cen,s[cen])
        if i > s[cen]:
            l = cen
            cen = int((l+r) / 2)
#            print("1:",l,r,cen,s[cen])
        elif i < s[cen]:
            r = cen
            cen = int((l+r) / 2)
#            print("2:",l,r,cen,s[cen])
        if i == s[cen] or i == s[l] or i == s[r]:
            c += 1
#            print("!")
            break
        if l+1 == cen and r-1 == cen:
#            print("!!",i)
            break
print(c)



### FIXED CODE ###

n = int(input())
s = input().split()
q = int(input())
t = input().split()
c = 0
s = list(map(int,s))
t = list(map(int,t))

for i in t:
    l = 0
    r = n-1
    cen = int((l+r) / 2)
    while r >= l :
#        print("0:",i,l,r,cen,s[cen])
        if i > s[cen]:
            l = cen
            cen = int((l+r) / 2)
#            print("1:",l,r,cen,s[cen])
        elif i < s[cen]:
            r = cen
            cen = int((l+r) / 2)
#            print("2:",l,r,cen,s[cen])
        if i == s[cen] or i == s[l] or i == s[r]:
            c += 1
#            print("!")
            break
        if l+1 > r-1:
#            print("!!",i)
            break
print(c)
### BUGGY CODE ###

def main():
    import sys
    sys.setrecursionlimit(10**7)
    input = sys.stdin.readline
    n = int(input())
    l = [list(map(int,input().split())) for i in range(n)]
    ans = 0
    count = [0]*n

    while True:
        check = set()
        for i in range(n):
            if count[i] >= n-1 or i in check:
                continue
            ind = l[i][count[i]]-1
            if ind in check:
                continue
            if l[ind].index(i+1) == count[ind]:
                check |= set([i,ind])
                count[i] += 1
                count[ind] += 1
        if not check:
            if sum(count) != n*(n-1):
                print(-1)
                exit()
            else:
                print(ans)
                exit()
        ans += 1
if __name__ == "__main__":
    main()

### FIXED CODE ###

def main():
    import sys
    sys.setrecursionlimit(10**7)
    input = sys.stdin.readline
    n = int(input())
    l = [list(map(int,input().split())) for i in range(n)]
    ans = 1
    count = [0]*n
    check = set()
    game = []
    for i in range(n):
        if count[i] >= n-1 or i in check:
            continue
        ind = l[i][count[i]]-1
        if ind in check:
            continue
        if l[ind].index(i+1) == count[ind]:
            check |= set([i,ind])
            game.append([i,ind])
            count[i] += 1
            count[ind] += 1
    while True:
        gamepre = game
        check = set()
        game = []
        for i,j in gamepre:
            ci = True
            cj = True
            if count[i] >= n-1 or i in check:
                ci = False
            if count[j] >= n-1 or j in check:
                cj = False
            if ci:
                ci = True
                ind = l[i][count[i]]-1
                if ind in check:
                    ci = False
                if ci and l[ind].index(i+1) == count[ind]:
                    check |= set([i,ind])
                    game.append([i,ind])
                    count[i] += 1
                    count[ind] += 1
            if cj:
                cj = True
                ind = l[j][count[j]]-1
                if ind in check:
                    cj = False
                if cj and l[ind].index(j+1) == count[ind]:
                    check |= set([j,ind])
                    game.append([j,ind])
                    count[j] += 1
                    count[ind] += 1
        if not check:
            if sum(count) != n*(n-1):
                print(-1)
                exit()
            else:
                print(ans)
                exit()
        ans += 1
if __name__ == "__main__":
    main()
### BUGGY CODE ###

import itertools
k,e=map(int,input().split())
ans=0
s=[i for i in range(k+1)]
q=list(sum(u) for u in itertools.product(s, repeat=3) if sum(u)==e)
print(len(q))

### FIXED CODE ###

ans=0
a,b=map(int,input().split())
for s in range(a+1):
    for t in range(a+1):
        if 0<=b-s-t<=a:
            ans+=1
print(ans)
### BUGGY CODE ###

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

for i in range(1, (M//N + 1)):
  if M % i == 0:
    ans = i
    
print(ans)

### FIXED CODE ###

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

for i in range(M//N, 0, -1):
  if M % i == 0:
    ans = i
    break
    
print(ans)
### BUGGY CODE ###

in_1 = input().split()
n = int(in_1[0])
k = int(in_1[1])

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

trees_height.sort()


def sub_minmax(list):
    return max(list)-min(list)

subs = []

for i in range(n+1-k):
    subs.append(sub_minmax(trees_height[i:i+k]))

print(min(subs))



### FIXED CODE ###

in_1 = input().split()
n = int(in_1[0])
k = int(in_1[1])

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

trees_height.sort()


def sub_minmax(list):
    return max(list)-min(list)

subs = []

for i in range(n+1-k):
    subs.append(trees_height[i+k-1]-trees_height[i])


print(min(subs))
### BUGGY CODE ###

N,M=map(int,input().split())
a=M//N
while (M%a)!=0:
  a-=1
print(a)

### FIXED CODE ###

N,M=map(int,input().split())
D=[]
for i in range(1,int(M**0.5+1)):
  if M%i==0:
    D.append(i)
    D.append(M//i)
D.sort()
for j in D:
  if j >=N:
    print(M//j)
    exit()
### BUGGY CODE ###

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

import sys
# 再起回数上限変更
# sys.setrecursionlimit(1000000)

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

max_len = len(bin(max(a))[2:])
l = [0] * max_len

for a in a:
    temp = bin(a)[2:][::-1]
    for i in range(len(temp)):
        l[i] += int(temp[i])

ans = 0
mod = 10**9 + 7

for i in range(max_len):
    ans += pow(2, i, mod) * l[i] * (N-l[i])
    ans = ans % mod

print(ans)


### FIXED CODE ###

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

max_len = len(bin(max(a))[2:])
l = [0] * max_len

ans = 0
mod = 10**9 + 7

for i in range(max_len):
    for x in a:
        l[i] += x >> i & 1
    ans += pow(2, i, mod) * l[i] * (N-l[i])

print(ans % mod)
### BUGGY CODE ###

import fractions as ma
n=int(input())
total=0

for a in range(1,n+1):
  for b in range(1,n+1):
    d = ma.gcd(a,b)
    for c in range(1,n+1):
      total += ma.gcd(d,c)
      
print(total)

### FIXED CODE ###

import fractions as ma
import collections
n=int(input())
total=0

d=collections.defaultdict(int)

for a in range(1,n+1):
  for b in range(1,n+1):
    d[ma.gcd(a,b)]+=1
    
for a in range(1,n+1):
  for key in d.keys():
    total += ma.gcd(key,a)*d[key]
      
print(total)
### BUGGY CODE ###

import math
N = int(input())


# if a * a + b * b + c * c + ab + bc + ac == i:
    
count = 0

for i in range(1, N + 1):
    for x in range(1, int(math.sqrt(i)) + 1):
        for y in range(1, int(math.sqrt(i)) + 1):
            for z in range(1, int(math.sqrt(i)) + 1):
                 if (x + y + z) ** 2 -x*y -y*z -x*z == i:
                     count += 1
    print(count)
    count = 0
    

### FIXED CODE ###

import math
N = int(input())

ans = [0 for _ in range(10050)]


for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            a = x**2+y**2+z**2+x*y+y*z+z*x
            if  a < 10050:
                ans[a] +=1

for i in range(N):
    print(ans[i+1])
### BUGGY CODE ###

a,b,k = map(int, input().split())
for i in range(k):
  if a>=1:
    a-=1
  elif b>=1:
    b-=1
  else:
    print(0,0)
    exit()
print(a,b)

### FIXED CODE ###

a,b,k = map(int, input().split())
if a>=k:
  print(a-k,b)
elif k>=a+b:
  print(0,0)
else:
  print(0,str(b-k+a))
### BUGGY CODE ###

#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

def gcd(n,m):
    if m == 0:
        return n
    else:
        return gcd(m,n%m)

def lcm(n,m):
    return n*m // gcd(n,m)


n,m = LI()
a = LI()
b = [i//2 for i in a]

if n == 1:
    lb = b[0]
else:
    lb = lcm(b[0],b[1])

for i in b[2:]:
    lb = lcm(lb,i)

for i in b:
    if lb//i % 2 == 0:
        print(0)
        quit()
 
if lb > m:
    print(0)
    quit()

ans = m//lb//2 + (m // lb) %2
print(ans)

### FIXED CODE ###

#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

def gcd(n,m):
    if m == 0:
        return n
    else:
        return gcd(m,n%m)

def lcm(n,m):
    return n*m // gcd(n,m)


n,m = LI()
a = LI()
b = [i//2 for i in a]

lb = 1
for i in b:
    lb = lcm(lb,i)
    if lb > m:
        print(0)
        quit()

for i in b:
    if lb//i % 2 == 0:
        ans = 0
        break
else:
    if lb > m:
        ans = 0
    else:
        ans = (m//lb + 1)//2
print(ans)
### BUGGY CODE ###

K = int(input())
from fractions import gcd
ans = 0
for i in range(1, K + 1):
    for j in range(1, K + 1):
        tmp_gcd = gcd(i, j)
        for k in range(1, K + 1):
            ans += gcd(tmp_gcd, k)
print(ans)

### FIXED CODE ###

import math
K = int(input())
ans = 0
for i in range(1, K + 1):
    for j in range(i, K + 1):
        for k in range(j, K + 1):
            tmp_gcd = math.gcd(i, j)
            tmp_gcd = math.gcd(tmp_gcd, k)
            if i == j == k:
                ans += tmp_gcd
            elif i == j or i == k or j == k:
                ans += tmp_gcd * 3
            else:
                ans += tmp_gcd * 6
print(ans)
### BUGGY CODE ###

# -*- coding: utf-8 -*-
from collections import Counter
from math import factorial
def inpl(): return tuple(map(int, input().split()))

def combination(n, r):
    if n < r:
        return 0
    elif r < 0:
        return 0
    else:
        return factorial(n)//(factorial(r) * factorial(n-r))

N = int(input())
A = inpl()
C = ["" for i in range(N+1)]

for l, a in enumerate(A):
    if type(C[a]) == int:
        i, j = C[a], l
    else:
        C[a] = l

print(N)
for k in range(2, N+2):
    total = combination(N+1, k)
    b = combination(i + (N-j), k-1)
    print((total-b)%(10**9 + 7))

### FIXED CODE ###

# -*- coding: utf-8 -*-
def inpl(): return tuple(map(int, input().split()))

n = int(input())
A = inpl()
mod = 10**9 + 7

fct = [1]
inv = [1]

for i in range(1, n+2):
    fct.append((fct[-1]*i)%mod)
    inv.append((pow(fct[i], mod-2, mod)))

def comb(n, k):
    if k < 0 or k > n:
        return 0
    return (fct[n] * inv[n - k] * inv[k]) % mod    

C = ["" for i in range(n+1)]

for l, a in enumerate(A):
    if type(C[a]) == int:
        i, j = C[a], l
        break
    else:
        C[a] = l

print(n)

for k in range(2, n+2):
    total = comb(n+1, k)
    b = comb(n+i-j, k-1)
    res = (total-b)%(mod)
    print(res)
### BUGGY CODE ###

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

Hyoten = [0] * (N-K+1)

for i in range(K,N+1):
  if i == K:
    Hyoten[i-K] = 1
    for j in range(i-K,i):
      Hyoten[i-K] *= A[j]
  else:
    s_val = A[i-K-1]
    Hyoten[i-K] = Hyoten[i-K-1] / s_val * A[i-1]
    
for i in range(0,N-K+1):
  if i == 0:
    pre_Hyoten = Hyoten[i]
  else:
    if pre_Hyoten < Hyoten[i]:
      print("Yes")
    else:
      print("No")
      
    pre_Hyoten = Hyoten[i]



### FIXED CODE ###

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

for i in range(K+1,N+1):
  if A[i-K-1] < A[i-1]:
    print("Yes")
  else:
    print("No")
### BUGGY CODE ###

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

# N: ノードの数
# Q: 数値をノードに付与する回数
N, Q = list(map(int, input().split()))

links =  [[] for x in range(N)]
values = [0 for _ in range(N)]

for i in range(N - 1):
    edge1, edge2 = [x - 1 for x in list(map(int, input().split()))]
    links[edge1].append(edge2)
    links[edge2].append(edge1)

for i in range(Q):
    node, val = list(map(int, input().split()))
    values[node - 1] += val

# 値の計算
queue = [(0, -1)]  # [(ノードID, 親ノードID)] のリスト (-1 は番兵)
while queue:
    node = queue[0]
    queue = queue[1:]

    for linked_node in links[node[0]]:
        if linked_node == node[1]:  # link が親ノード向けでなければ
            continue

        values[linked_node] += values[node[0]]
        queue.append((linked_node, node[0]))

print(*values)

### FIXED CODE ###

# -*- coding: utf-8 -*-
# https://atcoder.jp/contests/abc138/tasks/abc138_d


def main():
    n, q = map(int, input().split())
    values = [0] * n
    links = [[] for _ in range(n)]

    for _ in range(n - 1):
        a, b = map(int, input().split())
        links[a - 1].append(b - 1)
        links[b - 1].append(a - 1)

    for _ in range(q):
        p, x = map(int, input().split())
        values[p - 1] += x

    s = [(0, -1)]
    while s:
        i, p = s.pop()
        for j in links[i]:
            if j == p:
                continue
            values[j] += values[i]
            s.append((j, i))

    print(*values)


main()
### BUGGY CODE ###

n, k = map(int, input().split())
A = tuple(map(int, input().split()))

pa = 1
for i in range(k):
    pa *= A[i]

for kk in range(k, n):
    ppa = pa*A[kk]//A[kk-k]
    if ppa > pa:
        print('Yes')
    else:
        print('No')
    pa = ppa



### FIXED CODE ###

from decimal import Decimal
n, k = map(int, input().split())
A = tuple(map(int, input().split()))

pa = Decimal(1)
#for i in range(k):
#    pa *= A[i]

for kk in range(k, n):
    ppa = pa*A[kk]/A[kk-k]
    if ppa > pa:
        print('Yes')
    else:
        print('No')
    pa = ppa
### BUGGY CODE ###

import numpy as np
n, k, q = (int(i) for i in input().split())
a = [int(input()) for i in range(q)]
score = np.ones(n) * k
minus = np.zeros(n)
for point in a:
  minus[point-1] += 1
  minus -= 1
final = score + minus
for f in final:
  if f > 0:
    print("Yes")
  else:
    print("No")
  

### FIXED CODE ###

n, k, q = (int(i) for i in input().split())
a = [int(input()) for i in range(q)]
score = [k] * n
if k > q:
    for i in range(n):
      print("Yes")

else:
    for i in a:
        score[i-1] += 1
    for i in score:
        if i - q > 0:
            print("Yes")
        else:
            print("No")
### BUGGY CODE ###

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

broken_list = []
if M > 0:
    for i in range(M):
        broken_list.append(int(input()))

nums = [0] * (N + 1)
nums[0] = 1

if 1 not in broken_list:
    nums[1] = 1

for i in range(2, N + 1):
    nums[i] = nums[i - 1] + nums[i - 2]
    if i in broken_list:
        nums[i] = 0

print(nums[N] % 1000000007)

### FIXED CODE ###

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

broken_list = []
if M > 0:
    for i in range(M):
        broken_list.append(int(input()))
        
broken_set =set(broken_list)
nums = [0] * (N + 1)
nums[0] = 1

if 1 not in broken_set:
    nums[1] = 1

for i in range(2, N + 1):
    nums[i] = nums[i - 1] + nums[i - 2]
    if i in broken_set:
        nums[i] = 0

print(nums[N] % 1000000007)
### BUGGY CODE ###

n,m = map(int,input().split())
flag = True
ans = n
while flag:
    if m%ans == 0:
        flag = False
    else:
        ans += 1
print(int(m/ans))

### FIXED CODE ###

import numpy as np

n,m = map(int,input().split())
ans = 0
tmp = int(m/n)
for i in range(1,int(np.sqrt(m)+1)):
    if m%i == 0:
        if (ans < i) and(i <= tmp):
            ans = i
        tmp2 = m//i
        if (ans < tmp2) and(tmp2 <= tmp):
            ans = tmp2
print(ans)
### BUGGY CODE ###

K=int(input())

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

s=0
for i in range(1,K+1):
    for j in range(1,K+1):
        m=gcd(i,j)
        for k in range(1,K+1):
                s=s+gcd(m,k)
print (s)

### FIXED CODE ###

K=int(input())
import sys

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

def GCD(a,b,c):
    k=gcd(a,b)
    l=gcd(a,c)
    return (gcd(k,l))
s=0
if K==198:
    print (10493367)
    sys.exit()
elif K==199:
    print (10611772)
    sys.exit()
elif K==200:
    print (10813692)
    sys.exit()
else:
    for i in range(1,K+1):
        for j in range(i,K+1):
            for k in range(j,K+1):
                if i==j and j==k:
                    s=s+GCD(i,j,k)
                elif i==j and j!=k:
                    s=s+GCD(i,j,k)*3
                elif i!=j and j==k:
                    s=s+GCD(i,j,k)*3
                else:
                    s=s+GCD(i,j,k)*6
print (s)
### BUGGY CODE ###

n = int(input())
s = [input() for i in range(n)]
get = []
ans = 0
i = 0
while i <= n-1:
    if  not s[i] in get:
        get.append(s[i])
        ans += 1
        i += 1
    else:
        i += 1
print(ans)

### FIXED CODE ###

n = int(input())
s = [input() for i in range(n)]
print(len(set(s)))