CodeEff/ECCO huggingface dataset:
# Original solution
from collections import defaultdict


def main():
    n = int(eval(input()))
    card_list = list(map(int, input().split()))

    ans = len(set(card_list))

    d = defaultdict(int)
    for card in card_list:
        d[card] += 1

    one, two = 0, 0
    for card, num in list(d.items()):
        if num % 2 == 1:
            one += 1
        else:
            two += 1

    print((ans - two % 2))


if __name__ == '__main__':
    main()


# Optimized solution
from collections import defaultdict


def main():
    n = int(eval(input()))
    a_list = list(map(int, input().split()))
    s = len(set(a_list))
    if (len(a_list) - s) % 2 != 0:
        print((s - 1))
    else:
        print(s)


if __name__ == '__main__':
    main()
# Original solution
N=int(eval(input()))
A=list(map(int,input().split()))
A.sort()
S=[]
D=[]

for i in A:
    if i in S:
        D.append(i)
    else:
        S.append(i)
S=set(S)

import sys
if D==[]:
    print(N)
    sys.exit()

M=N-len(D)
if len(D)%2==1:
    print((M-1))
else:
    MaxD,MinD=D[-1],D[0]
    Med=-1
    for i in S:
        if MinD<=i<=MaxD:
            Med=i
            print(M)
            break
    if Med==-1:
        print((M-2))

# Optimized solution
N=int(eval(input()));A=list(map(int,input().split()));S=len(set(A));print((S-1+S%2))
# Original solution
from collections import Counter

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

num = len(Counter(A))

print((num - (N-num)%2))

# Optimized solution
# 入力
import sys
stdin = sys.stdin

def li(): return [int(x) for x in stdin.readline().split()]
def li_(): return [int(x)-1 for x in stdin.readline().split()]
def lf(): return [float(x) for x in stdin.readline().split()]
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(ns())
def nf(): return float(ns())

n = ni()
a = li()

unique = set(a)
doub = len(a) - len(unique)

if doub % 2 == 0:
    print((len(unique)))
else:
    print((len(unique) - 1))
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
s = []
c = 0
for i in a:
    if not i in s:
        s.append(i)
    else:
        c += 1
print((n - 2 * ((c + 1) // 2)))

# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))
b = set(a)
print((n - 2 * ((n - len(b) + 1) // 2)))
# Original solution
from collections import Counter
n = int(eval(input()))
A = sorted(list(map(int,input().split())))
c = Counter(A)
lst = list(c.values())
l,r = 0, len(lst)-1
while sum(lst) > len(lst):
    if lst[l] <= 1:
        l += 1
        continue
    else:
        if lst[r] <= 1:
            r -= 1
            continue
        else:
            lst[l] -= 1
            lst[r] -= 1
print((sum(lst)))

# Optimized solution
from collections import Counter
n = int(eval(input()))
A = sorted(list(map(int,input().split())))
c = list(Counter(A).values())
ans = len(c)
d = [i-1 for i in c]
print((ans if sum(d)%2==0 else ans-1))
# Original solution
from collections import*
from heapq import*
n,*a=list(map(int,open(0).read().split()))
q=[-t for t in list(Counter(a).values())]
heapify(q)
while q[0]<-1:
    p=heappop(q)
    if p<-2:
        heappush(q,p+2)
    else:
        heappush(q,p+1)
        r=heappop(q)
        if r<-1:
            heappush(q,r+1)
print((len(q)))

# Optimized solution
_,a=open(0);k=len(set(a.split()));print((k-(k%2<1)))
# Original solution
_,a=open(0);k=len(set(a.split()));print((k-(k%2<1)))

# Optimized solution
_,a=open(0);k=len(set(a.split()));print((k-1+k%2))
# Original solution
N= int(input())
a = list(map(int, input().split()))
a.sort()

while(True):
    is_finish = False
    mn = min(a)
    while(a.count(mn) == 1):
        idx = a.index(mn)+1
        if idx >= len(a):
            mn = min(a)
            break
        else:
            mn = a[idx]

    mx = max(a)
    while(a.count(mx) == 1):
        idx = a.index(mx) - 1
        if idx < 0 or mx == mn :
            mx = max(a)
            is_finish = True
            break
        else :
            mx = a[idx]

    if is_finish :
        break
    else:
        a.remove(mn)
        a.remove(mx)

print(len(a))


# Optimized solution
N = int(input())
a = set(map(int, input().split()))
print(len(a) if len(a) % 2 != 0 else len(a)-1)
# Original solution
from collections import Counter

N = int(eval(input()))
A = list(map(int,input().split()))
A.sort()
#print(A)

Ac = Counter(A).most_common()
#print(Ac)
ans = 0

for i in range(len(Ac)):
    if Ac[i][1] > 1:
        ans += Ac[i][1]-1

print((N-ans if ans%2 == 0 else N-ans-1))


# Optimized solution
from collections import Counter

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

Ac = Counter(A).most_common()
#print(Ac)
ans = 0

for i in range(len(Ac)):
    if Ac[i][1] > 1:
        ans += Ac[i][1]-1

print((N-ans if ans%2 == 0 else N-ans-1))
# Original solution
from collections import defaultdict
n = int(eval(input()))
a_list = [int(x) for x in input().split()]
d = defaultdict(int)
for a in a_list:
    d[a] += 1
print((len(list(d.keys())) - sum([1 for v in list(d.values()) if v % 2 == 0]) % 2))

# Optimized solution
from collections import defaultdict
n = int(eval(input()))
a_list = [int(x) for x in input().split()]
d = defaultdict(int)
for a in a_list:
    d[a] += 1
print((len(list(d.keys())) - sum([1 - v % 2 for v in list(d.values())]) % 2))
# Original solution
n=int(eval(input()))
a=list(map(int,input().split()))
a.sort()
k=1
lst=[]
for i in range(1,n):
    if a[i]==a[i-1]:
        k+=1
    else:
        lst.append(k)
        k=1
lst.append(k)
m=len(lst)
count=0
for i in range(m):
    if lst[i]%2==0:
        lst[i]=2
        count+=1
    else:
        lst[i]=1
if count%2==0:
    print(m)
else:
    print((m-1))

# Optimized solution
n=int(eval(input()))
a=list(map(int,input().split()))
a=len(set(a))
if a%2==0:
    print((a-1))
else:
    print(a)
# Original solution
n = int(eval(input()))
a = len(set(list(map(int,input().split()))))
if a%2==0:
    print((a-1))
else:
    print(a)


# Optimized solution
eval(input());a=len(set(input().split()));print((a-1+a%2))
# Original solution
from collections import Counter

N = int(eval(input()))
a = list(map(int, input().split(" ")))
c = Counter(a)

ref = [v-1 for k, v in list(c.items()) if v != 1]

ans = N - ((sum(ref)+1)//2)*2

print(ans)

# Optimized solution
N = int(eval(input()))
a = list(map(int, input().split(" ")))

uni = len(list(set(a)))
if uni % 2 == 0:
    uni -= 1

print(uni)
# Original solution
n = int(eval(input()))
l = len(set(list(map(int, input().split()))))
print((l - 1 if (n - l) % 2 else l))


# Optimized solution
n = int(eval(input()))
l = len(set(map(int, input().split())))
print((l - (n - l) % 2))
# Original solution
def main():
    import sys
    #input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations
    #from itertools import accumulate, product
    from bisect import bisect_left,bisect_right
    from math import floor, ceil
    #from operator import itemgetter

    #mod = 1000000007

    N = int(eval(input()))
    A = list(map(int, input().split()))
    a = len(set(A))
    res = len(A)-a
    if res%2==0:
        print(a)
    else:
        print((a-1))

if __name__ == '__main__':
    main()

# Optimized solution
input()
A = list(map(int, input().split()))
a = len(set(A))
res = len(A)-a
print(a-1) if res%2 else print(a)
# Original solution
import collections
n = int(input())
ais = list(map(int, input().split()))
cc = collections.Counter(ais)
k = n - len(cc)
print(len(cc) - (1 if (n - len(cc)) % 2 == 1 else 0))


# Optimized solution
n,s = int(input()),set(map(int, input().split()))
print(len(s) - (1 if (len(s) & 1 == 0) else 0))
# Original solution
#coding: UTF-8
import time
import collections
N=int(eval(input()))
lis=list(map(int, input().split()))
#kind=set(lis)
#kindn=len(kind)
kind_dict=collections.Counter(lis)
kindn=len(kind_dict)
out=0
for i in kind_dict:
    if kind_dict[i]%2==0:
        out+=1
if out%2==0:
    print(kindn)
else:
    print((kindn-1))

# Optimized solution
#coding: UTF-8
N=int(eval(input()))
lis=list(map(int, input().split()))
kind_dict={}
for i in lis:
    if i in kind_dict:
        kind_dict[i]+=1
    else:
        kind_dict[i]=1
kindn=len(kind_dict)
out=0
for i in kind_dict:
    if kind_dict[i]%2==0:
        out+=1
if out%2==0:
    print(kindn)
else:
    print((kindn-1))
# Original solution
N = int(eval(input()))
A = list(map(int,input().split(" ")))

dic = {}
one = []
for i in range(N):
	if not A[i] in one:
		one.append(A[i])

ans = len(one)
print((ans - ((ans+1) % 2)))





# Optimized solution
N = int(eval(input()))
A = list(map(int,input().split(" ")))
print((len(set(A)) - ((len(set(A))+1) % 2)))
# Original solution
from collections import Counter
N=int(eval(input()))
A=sorted(map(int,input().split()))
li=[]
i=0
while(i<N):
    cnt=0
    j=i
    while(j<N and A[i]==A[j]):
        cnt+=1
        j+=1
    li.append(cnt-1)
    i=j
l=len(li)
for i in range(l):
    for j in range(i+1,l):
        if li[i]==0:
            break
        d=min(li[i],li[j])
        li[i]-=d
        li[j]-=d
for i in range(l):
    li[i]%=2
ans=len(set(A))
for i in range(l):
    ans-=li[i]
print(ans)

# Optimized solution
N=int(eval(input()))
k=len(set(list(map(int,input().split()))))
print((k if k%2 else k-1))
# Original solution
# 同じカードが3枚以上ある場合は2枚ずつ減らせる
# 3枚以上で奇数の場合->1枚残る
# 3枚以上で偶数の場合->2枚残る

# 同じカードが2枚の場合
# 2枚のペアが２つ存在する場合
# 片方のペアから2枚選べば、両方の数字を1にできる
# ペアの数を2で割った数（切り捨て）*2のカードを減らせる

# 2枚のペアが1つ残ったとき
# そのときの全体数-2が答え

# 2枚のペアが残ってなければそのまま答え

N=int(eval(input()))
A=sorted(list(map(int,input().split())))
card=N
pairs=0
import itertools
for key,g in itertools.groupby(A):
  num=len(list(g))
  if num>2:
    if num&1:
      card-=(num-1)
    else:
      card-=(num-2)
      pairs+=1
  elif num==2:
    pairs+=1
if pairs>1:
  card-=(pairs//2)*2

if pairs&1:
  card-=2
  
print(card)

# Optimized solution
N,*A=list(map(int,open(0).read().split()))
A=len(set(A))
print(((A-1,A)[A&1]))
# Original solution
def d_card_eater(N, A):
    # 解説どおり
    from collections import Counter
    kind = len(set(A))  # 数列に現れる値の種類の数
    ans = kind if kind % 2 == 1 else kind - 1
    return ans

N = int(eval(input()))
A = [int(i) for i in input().split()]
print((d_card_eater(N, A)))

# Optimized solution
def d_card_eater(N, A):
    # 解説どおり
    kind = len(set(A))  # 数列に現れる値の種類の数
    ans = kind if kind % 2 == 1 else kind - 1
    return ans

N = int(eval(input()))
A = [int(i) for i in input().split()]
print((d_card_eater(N, A)))
# Original solution
import sys
from collections import Counter

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, *A = list(map(int, read().split()))

    counter = Counter(A)

    odd = even = 0
    for v in list(counter.values()):
        if v % 2 == 0:
            even += 1
        else:
            odd += 1

    if even % 2 == 0:
        ans = odd + even
    else:
        ans = odd + even - 1

    print(ans)
    return


if __name__ == '__main__':
    main()


# Optimized solution
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, *A = list(map(int, read().split()))

    K = len(set(A))
    if K % 2 == 1:
        ans = K
    else:
        ans = K - 1

    print(ans)
    return


if __name__ == '__main__':
    main()
# Original solution
n=int(eval(input()))
a=sorted([int(i) for i in input().split()])

def groupby(a):
    a2=[[a[0],1]]
    for i in range(1,len(a)):
        if a2[-1][0]==a[i]:
            a2[-1][1]+=1
        else:
            a2.append([a[i],1])
    return a2
a=groupby(a)
#print(a)
l=len(a)
for i in range(l):
    if a[i][1]%2==0:
        a[i][1]=2
    else:
        a[i][1]=1
c=0
for i in range(l):
    if a[i][1]==2:
        c+=1
if c%2==0:
    print(l)
else:
    print((l-1))


# Optimized solution
n=int(eval(input()))
def groupby(a):
    a2=[[a[0],1]]
    for i in range(1,len(a)):
        if a2[-1][0]==a[i]:
            a2[-1][1]+=1
        else:
            a2.append([a[i],1])
    return a2

b=groupby(sorted([int(i) for i in input().split()]))
l=len(b)
co=0
for i in range(l):
    co+=(b[i][1]-1)
if co%2==0:
    print(l)
else:
    print((l-1))
# Original solution
while True:
    n, m, a = list(map(int, input().split()))

    if n + m + a == 0:
        break

    lines = list(sorted([tuple(map(int, input().split())) for _ in range(m)]))

    replace = list(range(1, n+1))

    for l in lines:

        _, p, q = l

        p -= 1
        q -= 1

        replace[p], replace[q] = replace[q], replace[p]

    print((replace[a-1]))

# Optimized solution


while True:
    # num_columns: ????£?????????°
    # num_lines: ?¨??£?????????°(???????????????2????´???????????????°)
    # entry: ????????????????????????????§?????????´????????????
    num_columns, num_lines, entry = list(map(int, input().split()))

    if num_columns == 0 and num_lines == 0 and entry == 0:
        break

    lines = []
    for _ in range(num_lines):
        height, p, q = list(map(int, input().split()))
        lines.append((height, p-1, q-1)) # ????????????0?????????????§????????????§???????????????

    # lines??????????????????????????§???????????????????????????????´?????¨??£???????????????\???????????§
    # ??????????????????????????°??????????????????????????????
    lines.sort()
    lines.reverse()
    # ??????2??????????????§???lines????????????????´??????§?????????????????¶

    result = list(range(1, num_columns+1)) # ??????????§????????????´????????¨????????????

    for line in lines:
        height, p, q = line
        
        # ?????????`replace`???p????????¨q?????????????????????
        result[p], result[q] = result[q], result[p]

    for index, element in enumerate(result):
        if element == entry:
            print((index + 1)) # ????????????0?????????????§????????????§???????????????
            break
    # print(result.index(entry) + 1) ??§?????????
# Original solution
a=input()
ary=list(a)
count = 0

tmp=""
for i,v in enumerate(ary):
  if v == tmp:
    del(ary[i])
    tmp=v
  else:
    tmp=v

def countStr(arys):
  cW=0
  cB=0
  for i in arys:
    if i == "B":
      cB += 1
    else:
      cW += 1
  return cW, cB

while len(set(ary)) != 1:
  count += 1
  #W, B=countStr(ary)

  
  if ary[len(ary)-1] == "W":
    ary.append("B")
    m = 2
    for i in ary:
      if ary[len(ary)-m] == "W":
        ary[len(ary)-m] = "B"
        m += 1 
      else:
        break
  else:
    ary.append("W")
    m=2
    for i in ary:
      if ary[len(ary)-m] == "B":
        ary[len(ary)-m] = "W"
        m += 1
      else:
        break
  
print(count)

# Optimized solution
a=input()
ary=list(a)
count = 0

tmp=ary[0]
for i,v in enumerate(ary):
  if v == tmp:
    tmp=v
  else:
    tmp=v
    count += 1

print(count)
# Original solution
s=input()
l=0
r=len(s)-1

news=""
i=0
while i<len(s):
    if s[i]=="W":
        while i<len(s) and s[i]=="W":
            i+=1
        news+=s[i-1]
    else:
        while i<len(s) and s[i]=="B":
            i+=1
        news+=s[i-1]
print((len(news)-1))

# Optimized solution
s=input()
now=s[0]
ans=0
for i in range(1,len(s)):
    if now!=s[i]:
        ans+=1
        now=s[i]
print(ans)
# Original solution

def main():
    s = input()
    check_b = lambda x: x=='B'
    check_w = lambda x: x=='W'
    if all(map(check_b, list(s))) or all(map(check_w, list(s))):
        return 0

    work = list(s)[:]
    flag_b = False
    flag_w = False
    stack = []
    cnt = 0
    for i in range(len(work)-1):
        w_list = work[i:i+2]
        if w_list[0] == w_list[1]:
            pass
        else:
            cnt += 1

    return cnt



if __name__ == '__main__':
    print(main())

# Optimized solution
def main():
    s = input()
    check_b = lambda x: x=='B'
    check_w = lambda x: x=='W'
    if all(map(check_b, list(s))) or all(map(check_w, list(s))):
        return 0

    work = list(s)[:]
    cnt = 0
    for i in range(len(work)-1):
        w_list = work[i:i+2]
        if w_list[0] == w_list[1]:
            pass
        else:
            cnt += 1

    return cnt



if __name__ == '__main__':
    print(main())
# Original solution
# ABC_129 C

def stairs(n, a):
    num_list = [i for i in range(n+1) if i not in a]
    dp = [0 for _ in range(n+1)]
    dp[0] = 1
    if 1 not in a:
        dp[1] = 1
    for i in num_list:
        if i > 1:
            dp[i] = dp[i-1] + dp[i-2]

    result = dp[n] % 1000000007

    print(result)


n, m = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(m)]

if __name__ == '__main__':
    stairs(n, a)

# Optimized solution
# ABC_129 C

def stairs(n, a):
    num_list = set(i for i in range(n+1) if i not in a)
    dp = [0 for _ in range(n+1)]
    dp[0] = 1
    if 1 not in a:
        dp[1] = 1
    for i in num_list:
        if i > 1:
            dp[i] = dp[i-1] + dp[i-2]
            
    result = dp[n] % 1000000007

    print(result)

    
n, m = list(map(int, input().split()))
a = set(int(eval(input())) for _ in range(m))


if __name__ == '__main__':
    stairs(n, a)
# Original solution
import sys

sys.setrecursionlimit(10 ** 6)

N, M = list(map(int, input().split()))
A = []
ANS = []
for i in range(N + 10):
    ANS.append(None)

for _ in range(M):
    a = int(eval(input()))
    A.append(a)
    ANS[a] = 0


def f(x):
    if ANS[x] is not None:
        return ANS[x]

    if x > N:
        return 0
    if x == N:
        return 1

    if ANS[x + 1] is None:
        x1 = f(x + 1)
        ANS[x + 1] = x1
    else:
        x1 = ANS[x + 1]

    if ANS[x + 2] is None:
        x2 = f(x + 2)
        ANS[x + 2] = x1
    else:
        x2 = ANS[x + 2]

    ans = x1 + x2
    # ans = f(x + 1) + f(x + 2)
    ANS[x] = ans
    return ans


print((f(0) % 1000000007))


# Optimized solution
import sys

sys.setrecursionlimit(10 ** 6)

N, M = list(map(int, input().split()))
A = []
ANS = []
for i in range(N + 10):
    ANS.append(None)

for _ in range(M):
    a = int(eval(input()))
    A.append(a)
    ANS[a] = 0


def f(x):
    if ANS[x] is not None:
        return ANS[x]

    if x > N:
        return 0
    if x == N:
        return 1

    ans = f(x + 1) + f(x + 2)
    ANS[x] = ans
    return ans


print((f(0) % 1000000007))
# Original solution
import sys

sys.setrecursionlimit(10 ** 6)

N, M = list(map(int, input().split()))
A = []
for _ in range(M):
    a = int(eval(input()))
    A.append(a)

dp = []
for i in range(N + 1):
    dp.append(None)
dp.append(0)

dp[N] = 1

for i in range(N - 1, -1, -1):
    if i in A:
        dp[i] = 0
        continue
    dp[i] = (dp[i + 1] + dp[i + 2]) % 1000000007

# print('dp', dp)
print((dp[0]))


# Optimized solution
N, M = list(map(int, input().split()))
A = []

dp = []
for i in range(N + 1):
    dp.append(None)
    A.append(None)

for _ in range(M):
    a = int(eval(input()))
    A[a] = 1

dp.append(0)
dp[N] = 1

for i in range(N - 1, -1, -1):
    if A[i]:
        dp[i] = 0
        continue
    dp[i] = dp[i + 1] + dp[i + 2]

# print('dp', dp)
print((dp[0] % 1000000007))
# Original solution
N, M = list(map(int, input().split()))
A = []

dp = []
for i in range(N + 1):
    dp.append(None)
    A.append(None)

for _ in range(M):
    a = int(eval(input()))
    A[a] = 1

dp.append(0)
dp[N] = 1

for i in range(N - 1, -1, -1):
    if A[i]:
        dp[i] = 0
        continue
    dp[i] = dp[i + 1] + dp[i + 2]

# print('dp', dp)
print((dp[0] % 1000000007))


# Optimized solution
N, M = list(map(int, input().split()))
A = set()

dp = []
for i in range(N + 1):
    dp.append(None)

for _ in range(M):
    a = int(eval(input()))
    A.add(a)

dp.append(0)
dp[N] = 1

for i in range(N - 1, -1, -1):
    if i in A:
        dp[i] = 0
        continue
    dp[i] = dp[i + 1] + dp[i + 2]

# print('dp', dp)
print((dp[0] % 1000000007))
# Original solution
N, M = list(map(int, input().split()))
A = []
for i in range(M):
  A.append(int(eval(input())))

X = [0] * (N + 1)
for i in range(N + 1):
  if i == 0:
    X[i] = 1
  elif i == 1:
    if 1 not in A:
      X[i] = 1
    else:
      X[i] = 0
  else:
    if i in A:
      X[i] = 0
    else:
      X[i] = (X[i - 1] + X[i - 2]) % 1000000007

print((X[N]))


# Optimized solution
N, M = list(map(int, input().split()))
A = []
for i in range(M):
  A.append(int(eval(input())))

X = [0] * (N + 1)
for i in A:
  X[i] = -1

for i in range(N + 1):
  if i == 0:
    X[i] = 1
  elif i == 1:
    if X[i] == -1:
      X[i] = 0
    else:
      X[i] = 1
  else:
    if X[i] == -1:
      X[i] = 0
    else:
      X[i] = (X[i - 1] + X[i - 2]) % 1000000007

print((X[N]))
# Original solution
n, m = list(map(int, input().split()))
list_score = set([int(eval(input())) for _ in range(m)])

dp = [0] * (n + 1)
mod = pow(10, 9) + 7

dp[0] = 1
if 1 in list_score:
    dp[1] = 0
else:
    dp[1] = 1

for i in range(2, n + 1):
    if i not in list_score:
        dp[i] = dp[i - 1] + dp[i - 2]
        dp[i] %= mod

print((dp[n]))

# Optimized solution
n, m = list(map(int, input().split()))
set_A = set()
dp = [0]*n
mod = pow(10, 9) + 7

for _ in range(m):
    set_A.add(int(eval(input())))

if 1 not in set_A:
    dp[0] = 1
if 2 not in set_A and n != 1:
    dp[1] = 1 + dp[0]

for i in range(2, n):
    if i + 1 not in set_A:
        dp[i] += (dp[i-1] + dp[i-2])%mod

print((dp[n-1]))
# Original solution
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def _pf(s): return print(s, flush=True)

#  f = open('C_input_29.txt')
#  lines = f.readlines()
#  f.close()
#  N, M = map(int, lines[0].split())
#  A = []
#  for line in lines[1:]:
#      A.append(int(line))

N, M = LI()
A = [_I() for i in range(M)]

#  if M != 0:
#      # 連続した壊れた段がある場合は0
#      B = [i for i in A]
#      B.remove(B[0])
#      B.append(10**15+100)
#      diffs = [b - a for a, b in zip(A,B)]
#      #  print(diffs)

#      if any(i == 1 for i in diffs):
#          # 隣同士なので0
#          print(0)
#          exit()
#  print('hoge')
"""
考え方
xにたどり着く通りは、x-1とx-2段目にたどり着く通りの合計
dp
3が障害のとき
1へは1通り
2へは0からと1からの2通り
3へは0通り
4へは2からの2通りと、3からの0通りで2通り
5へは3からの0通りと4からの2通りで2通り
6へは4からの2通りと5からの2通りで4通り
"""
#  dp = {}
dp = [0 for i in range(N+1)]
#  print('fua')
dp[0] = 1
dp[1] = 1 if 1 not in A else 0
#  [dp.update({i: (dp[i-1] + dp[i-2])%mod}) if i not in A else dp.update({i: 0}) for i in range(2, N+1)]
for i in range(2, N+1):
    #  print(i)
    # i段目までの通りを計算する
    if i not in A:
        # i段目が障害のときは0になっているので飛ばす
        dp[i] = dp[i-1] + dp[i-2]
        dp[i] %= mod

print(dp[N])


# Optimized solution
# -*- coding: utf-8 -*-
import sys

mod = 10 ** 9 + 7

def get_nums(n):
    res = [0 for _ in range(n)]
    for i in range(n):
        res[i] = int(eval(input()))
    return res


def get_numbers():
    return list(map(int, input().split()))


n, m = get_numbers()
a = set(get_nums(m))

dp = [0 for _ in range(n + 1)]
dp[0] = 1
if 1 not in a:
    dp[1] = 1

for i in range(2, n + 1):
    if i not in a:
        dp[i] = dp[i - 1] + dp[i - 2]
        dp[i] %= mod

print((dp[-1]))
# Original solution
import sys

n, m = list(map(int, input().split()))
A = []
for i in range(m):
    A.append(int(eval(input())))
dp = [0] * (n+1)
mod = 1000000007
dp[0] = 1
if 1 in A:
    if 2 in A:
        print((0))
        sys.exit()
else:
    dp[1] = 1
for i in range(2, n+1):
    if i in A:
        dp[i] = 0
    else:
        dp[i] = (dp[i-1] + dp[i-2]) % mod
print((dp[-1]))

# Optimized solution
n, m = list(map(int, input().split()))
mod = 1e9 + 7
ok = [True] * (n+1)
for i in range(m):
    a = int(eval(input()))
    ok[a] = False
dp = [0] * (n+1)
dp[0] = 1
for i in range(n):
    for j in range(i+1, 1 + min(n, i + 2)):
        if ok[j]:
            dp[j] += dp[i]
            dp[j] %= mod
print((int(dp[-1])))