# C - Typical Stairs
import numpy as np

n, m = map(int, input().split())
a = [int(input()) for i in range(m)]
memo = {}

def dp(p, a, memo):
    if p in memo.keys():
        return memo[p]
    else:
        ans = 0
        if p == 0:
            return 1
        elif p == 1:
            return 1
        else:
            if p-1 in a:
                ans = dp(p-2, a, memo)
            elif p-2 in a:
                ans = dp(p-1, a, memo)
            else:
                ans = dp(p-1, a, memo) + dp(p-2, a, memo)
        memo[p] = ans
        return ans

Zero = False
for i in range(m-1):
    if a[i+1] - a[i] == 1:
        Zero = True

if Zero:
    print(0)
else:    
    print(dp(n, a, memo) % (10**9+7))