def  solve(n, total):
    cnt = 0

    if total == n:
        return 1
    else:
        if total > n:
            return 0
        else:
            cnt += solve(n, total+1)
            cnt += solve(n,total+2)

    return cnt



n,m = map(int, input().split())

steps = [True] * (n+1)
for i in range(m):
    steps[int(input())] = False

ans = 1

l = 0
r = 0
idx = 0
while l < len(steps):

    if idx >= len(steps):
        ans *= solve(r-l,0)
        break


    if steps[idx]:
        r = idx
    else:
        # idx段目が壊れてる
        #次も壊れてるなら終わり
        if steps[idx+1] == False:
            print(0)
            exit()
        else: 
            ans *= solve(r-l,0)
            l = idx+1
            r = idx+1
    idx += 1

print(ans%(10**9+7))