
import sys


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

dp = [0] * (n+1)
dp[0] = 1
dp[1] = 1
dp[2] = 2
"""
for i in range(3, n+1):
    dp[i] = dp[i-2] + dp[i-1]
"""

ans = 1

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

    if idx >= len(steps):
        if r-l > finished:
            for i in range(finished+1, r-l+1):
                dp[i] = dp[i-2] + dp[i-1]
                finished = i
        ans *= dp[r-l]
        break

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

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