import sys


def fb(num):
    a, b = 1, 0
    for _ in range(num):
        a, b = a + b, a
    return a


N, M = map(int,input().split())
a = [int(input()) for i in range(M)]
for i in range(len(a)-1):
    if a[i]+1 == a[i+1]:
        print(0)
        sys.exit()

k =[a[0]-1]
for i in range(len(a)-1):
    k.append(a[i+1]-a[i]-2)
k.append(N-a[-1]-1)
ans = 1
# print(k)
for g in k:
    ans *= int(fb(g))
    ans = ans%1000000007
print(int(ans))
