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

if M == 0:
    num_list.append(N+1)
else:
    list.sort(reverse = True)
    rest = N + 1
    for i in list:
        num_list.append(rest - i - 1)
        rest = i
    num_list.append(list[-1])

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