n,m=map(int,input().split())
a_list=[]
for i in range(0,m):
  a_list.append(int(input()))
a=0
b=1
k=0
for i in range(0,n):
  if a_list[k]!=i+1:
  	(a,b)=(b,a+b)
  else:
    k=k+1
    (a,b)=(b,0)
print(b)
