import math

#n = int(input())
n, m = [int(i) for i in input().split()]
#table = [[int(i) for i in input().split()] for n in range(n)]
#list = [int(i) for i in input().split()]
#s = input()
#list = list(s)

s = [int(input()) for i in range(m)] #m行1列入力

MOD = 1000000007

fib_memo = {}
def fib(n):
    if n == 0: return 0
    if n < 3: return 1
    if n not in fib_memo:
        fib_memo[n] = fib(n-1) + fib(n-2) % MOD
    return fib_memo[n]

kotae = 1

if (m == 0) :
    kotae = (kotae * fib(n)) % MOD
else :
    for i in range(m + 1) :
        if (i == 0) :
            kotae = kotae * fib(s[i]) % MOD
        elif (i == m) :
            kotae = kotae * fib(n - s[i-1]) % MOD
        else :
            kotae = kotae * fib(s[i] - s[i-1] - 1) % MOD


print(kotae)