n, m = map(int, input().split())
a = [0]
for i in range(m):
    a.append(int(input()))
a.append(n)
    
def ways(n):
    if n == 1:
        return 1
    elif n == 0:
        return 0
    elif n == 2:
        return 2
    else:
        return ways(n-1) + ways(n-2)

times = 1
flag = 0
for i in range(len(a)-1):
    t = a[i+1]-a[i]
    if a[i+1] == 1 or a[i] == n-1 or t == 0:
        continue
    elif t == 1:
        flag = 1
        break
    else:
        times *= ways(t-1)

if flag:
    print(0)
else:
    print(times % (10**9 +7))