def Fib(n):
    if n==0:
        return 1#F0
    elif n==1:
        return 1 #F1
    else:
        fibo_minus1 = 1 #Fn-1
        fibo_minus2 = 1 #Fn-2
        for i in range(2,n):
            fibo = fibo_minus1 + fibo_minus2 #Fn = Fn-1 + Fn-2
            fibo_minus2 = fibo_minus1 # Fn-2の値を更新
            fibo_minus1 = fibo # Fn-1の値を更新
        return fibo

n,m = map(int,input().split())
s =[]
ans = 1
for i in range(m):
    s.append(int(input()))
    if i == 0:
        ans*=Fib(s[0])
    else:
        if s[i]-s[i-1] == 1:
            print(0)
            exit()
        if  s[i]-s[i-1] == 0:
            continue
        ans *= Fib(s[i]-s[i-1]-1)
if s == []:
    ans *= Fib(n)
    print(ans)
    exit()
if s[-1] != n:
    ans *= Fib(n-s[-1])
    
        
print(ans%1000000007) 