from collections import deque


def Fibonacci(n): 
    if n<0: 
        print("Incorrect input") 
    # First Fibonacci number is 0 
    elif n==1: 
        return 1
    # Second Fibonacci number is 1 
    elif n==2: 
        return 2
    else: 
        return Fibonacci(n-1)+Fibonacci(n-2) 
        

N, M = map(int, input().split())

A = deque()

for _ in range(M):
    A.append(int(input()))

pos = 0
diff = []
la = None

for a in A:
    if la and a - la == 1:
        print(0)
        exit()
    d = (a) - pos
    diff.append(d)
    pos = a
    la = a

# 最後の階段
diff.append(N - pos)
diff = list(filter(lambda x: False if x <= 0 else True, diff))
F = [Fibonacci(d) for d in diff]

_sum = 1
for f in F:
    _sum *= f

print(_sum // 1000000007)