N, M = map(int, input().split())
a_list = [int(input()) for _ in range(M)]

mod = 1000000007
  
ans = 1
result = {0:1, 1:1}

def fib(x):
    if x == 0 or x == 1:
        return result[x]
    else:
        a = result.get(x-1) if result.get(x-1) else fib(x - 1)
        result[x-1] = a
        b = result.get(x-2)
        
        return a + b

x = 0

for a in a_list:
    if a == x:
        ans = 0
        break
    
    ans = (ans * fib((a-1)-x)) % mod
    x = a+1
else:
    ans = (ans * fib(N-x)) % mod

print(ans)