import math
import fractions
(n,m)=map(int,input().split())
a=[0]*(n+2)
b=[0]*(n+2)
for i in range(m):
    t=int(input())
    a[t]=1
b[0]=1
for i in range(n+1):
    if(a[i]==1):
        continue
    if(i==0):
        continue
    if(i==1):
        b[i]=b[i-1]
        continue
    b[i]=b[i-1]+b[i-2]

print(b[n])

