n,m = map(int,input().split())
a_list = [int(input()) for x in range(m) ]
import numpy as np
kaidan = np.zeros(n+1)

kaidan[1] = 1 
kaidan[2] = 2 
if 1 in a_list:
    kaidan[1] = 0
    kaidan[2] = 1
if 2 in a_list: 
    kaidan[2] = 0

for x in range(3,n+1):
    kaidan[x] = kaidan[x-1]+kaidan[x-2]
    if x in a_list:
        kaidan[x]  = 0
print(int(kaidan[n]))