import sys

n, m = map(int, input().split())
if n == 1:
    print('1')
    exit(0)
if n == 2 and m == 0:
    print('2')
    exit(0)
a = []
for i in range(m):
    a.append(int(input()))
if n == 2 and m == 1:
    print('1')
    exit(0)
fib = [0, 1, 2]
for i in range(3, n+1):
    fib.append(fib[i - 2] + fib[i - 1])
way = []
for i in range(m):
    way.append(fib[int(a[i])+1] - fib[int(a[i])])
    if i > 0:
        if a[i - 1] + 1 == a[i]:
            print('0')
            exit(0)
way.append(fib[n - int(a[m-1]) - 1])
ans = 1
for i in range(len(way)):
    ans *= way[i]
print(ans % 1000000007)
