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

def fib(n):
    f = (((((1 + 5**0.5) / 2)**n) % MOD ) / 5**0.5 + 0.5) % MOD
    return int(f)

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)