def fib(n):
    a, b = 1, 1
    for _ in range(n):
        a, b = b, a + b
    return a
 
from sys import stdin
n,m = [int(x) for x in stdin.readline().rstrip().split()]
a = [-1] + [int(stdin.readline().rstrip()) for _ in range(m)] + [n-1]
print(a)
ans = 1
for i in range(len(a) - 1):
    if a[i] != 0 and a[i + 1] != n and a[i + 1] - a[i] == 1:
        print(0)
        exit()
    ans = ans * fib(a[i + 1] - a[i] - 2) % (10 ** 9 + 7)
print(ans)