[n,m] = [int(i) for i in input().split()]
ls = []
tmp1 = -1
tmp2 = 0
checker = 0
ans = []
for i in range(m):
    tmp2 = int(input())
    ls.append(tmp2)
    if tmp2 - tmp1 == 1:
        checker = 1
        print(0)
        break
    tmp1 = tmp2
#i番目までの道の数
if n == 1:
    if 1 in ls:
        print(0)
    else:
        print(1)
else:
    for i in range(1,n+1):
        if i == 1:
            #1段目が使える時
            if 1 not in ls:
                ans.append(1)
            else:
                ans.append(0)
        elif i == 2:
            #2段目が使える時
            if 1 not in ls and 2 not in ls:
                ans.append(2)
            else:
                ans.append(1)
        else:
            if i in ls:
                ans.append(0)
            else:
                ans.append((ans[i-3]+ans[i-2])%(10**9+7))
if checker == 0:
    print(ans[n-1])
