n, m = map(int, input().split())

def fib(n):
    if n == 0:
        return 0
    else:
        a0 = 0
        a1 = 1
        for i in range(n-1):
            b = a1
            a1 += a0
            a0 = b
        return a1

count = 1
b = 0
for i in range(m):
    a = int(input())
    if a == 1:
        b = 1
        continue
    if num == 1:
        count *= 0
        break
    if b == 0:
        num = a - b
    else:
        num = a - b - 1
    count *= fib(num)
    b = a 
#     print(b, count, num)
    
count *= fib(n - b)

print(count%1000000007)