n, m = map(int,input().split())
full = 1000000007
a = []
for _ in range(m):
    a += [int(input())]

b = []
start = 0
for x in a:
    b += [-start+x]
    start = x+1
b  += [-start+n+1]

from functools import lru_cache
@lru_cache(maxsize=None)
def steps(N):
    if N in [1,2]:
        return 1
    else:
        return steps(N-1)+steps(N-2)

if 0 in b:
    print(0)

else:
    ans = 1
    for z in b:
        ans *= steps(z)

    print(ans%full)
