import sys
n, m = map(int, input().split())
kaidan = [1] * (n+1)
for _ in range(m):
    a = int(input())
    kaidan[a] = -1

fiblist = [0] * (n+1)
fiblist[1] = 1
for i in range(2, n+1):
    fiblist[i] = (fiblist[i-2] + fiblist[i-1]) % 1000000007

ans = 1
renzoku = 0
koshou = 0
for i in range(n+2):
    if i == n+1:
        temp = fiblist[renzoku]
        ans = (ans * temp) % 1000000007
    elif kaidan[i] == 1:
        renzoku += 1
        koshou = 0
    else:
        koshou += 1
        if koshou == 2:
            print(0)
            sys.exit()
        else:
            temp = fiblist[renzoku]
            ans = (ans * temp) % 1000000007
        renzoku = 0

print(ans)