n,m=map(int, input().split())  #複数数値入力

list_a = []
for i in range(m):
    list_a.append(int(input()))
    
def countWays_memo(n):
    memo = [-1]*(n+1)
    def _countWays(n):
        if n < 0:
            return 0
        elif n == 0:
            return 1
        else:
            if memo[n] > -1:
                return memo[n]
            else:
                memo[n] = _countWays(n-1) + _countWays(n-2) 
                return memo[n]
    return _countWays(n)

steps = []
now_step = -1
for i in range(len(list_a)):
    steps.append(list_a[i]-now_step-2)
    now_step = list_a[i]
steps.append(n-now_step-1)

if steps[0] == 0:
    steps[0] = 1

dict_steps = {}
for s in set(steps):
    if s == 0:
        print(0)
    else:
        dict_steps[s] = steps.count(s)

ans = 1
for k,v in dict_steps.items():
    ans *= countWays_memo(k)**v
    
if steps.count(0) == 0:
    print(ans% 1000000007)