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

N,M = map(int,input().split())

list=[]
for i in range(M):
    list.append(int(input()))

for i in range(1,len(list)):
    if list[i]-list[i-1] == 1:
        print(0)
        exit()

num_list = []
rest = N
cnt = 0
for i in range(N+1):
    if i in list:
        num_list.append(cnt)
        cnt = 0
    elif i == N:
        num_list.append(cnt + 1)
    else:
        cnt += 1

ans = 1
for i in num_list:
    ans = ans * Fib(i+1)
print(ans % 1000000007)

