def function(n):
    if n <= 1:
        return 1
    else:
        return function(n-1) + function(n-2)

N, M = (int(x) for x in input().split())
a = [-1]
for i in range(M):
    a.append(int(input()))

a.append(N+1)
ans = 1
for i in range(M+1):
    length = a[i+1] - a[i] - 1
    if length == 0:
        print(0)
        exit()
    else:
        ans *= function(length-1)

print(ans%(10**9+7))
