n,m = map(int,input().split())
a = [int(input()) for _ in range(m)]
fibo = [1,1]
r = [a[0]-1]

for i in range(m-1):
    r.append((a[i+1]-a[i])-2)
    if a[i+1] - a[i] == 1:
        print(0)
        exit()
else:
    r.append(n-a[-1]-1)

    for i in range(max(r)+2):
        fibo.append((fibo[-1]+fibo[-2])%1000000007)

    ans = 1

    for i in range(len(r)):
        ans = (fibo[r[i]] * ans)%1000000007

    print(ans)