def Fib(n):    
    if n == 1:
        return 1
    if n == 0:
        return 0
    else:
        return Fib(n-1)+Fib(n-2)

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()
        ans *= Fib(s[i]-s[i-1]-1)
if s[-1] != n:
    ans *= Fib(n-s[-1])
    
        
print(ans%1000000007) 