STR = input().split()
N = int(STR[0])
M = int(STR[1])
Flag = True
a = []
a.append(-1)
for i in range(M):
    a.append(int(input()))
a.append(N+1)

for i in range(M+1):
    if (a[i+1]-a[i]) == 1:
        Flag = False

fib = []
fib.append(1)
fib.append(1)

for i in range(2,N):
    fib.append(fib[i-1] + fib[i-2])

SUM = 1
num = 0
for i in range(1,M+2):
    num = a[i]-1 - (a[i-1] +1)
    #print(a[i]-1)
    #print(a[i-1]+1)
    SUM = SUM * fib[num] % 1000000007
    #print(num)
    
if Flag:
    print(SUM)
else:
    print(0)