import sys
input = sys.stdin.readline

N, M = map(int, input().split())
a = []
for _ in range(M):
    a.append(int(input()))

if M == 0:
    arr = [N]
else:
    arr = [a[0] - 1]
    for i in range(M-1):
        diff = a[i+1] - a[i] - 1
        arr.append(diff)
        if diff == 0:
            print(0)
            exit()
    arr.append(N - a[-1] - 1)

count = [1, 1, 2]
for i in range(3, max(arr)+1):
    count.append(count[-1] + count[-2])

ans = 1
for value in arr:
    ans *= count[value]
    
print(ans%1000000007)


