import math
def fib(q):
   fibonacci = [0,1]
   for i in range(2,q):
       fibonacci.append(fibonacci[i-2]+fibonacci[i-1])
   return fibonacci[q-1]
n,m = list(map(int, input("").split()))
a=[]
a.append(-1)
for i in range(m):   
    a.append(int(input()))
a.append(n+1)
out=1
c=10**9+7
for i in range(m+1):
    out*=int(fib(a[i+1]-a[i]))
    out%=c
print(out) import math math def fib(q):
   fibonacci = [0,1]
   for i in range(2,q):
       fibonacci.append(fibonacci[i-2]+fibonacci[i-1])
   return fibonacci[q-1] fib fibonacci = [0,1] fibonacci [0,1] 0 1 for i in range(2,q):
       fibonacci.append(fibonacci[i-2]+fibonacci[i-1])
    i range(2,q) range 2 q fibonacci.append(fibonacci[i-2]+fibonacci[i-1]) fibonacci.append fibonacci append fibonacci[i-2]+fibonacci[i-1] fibonacci[i-2] fibonacci i-2 i 2 fibonacci[i-1] fibonacci i-1 i 1 return fibonacci[q-1] fibonacci[q-1] fibonacci q-1 q 1 q q n,m = list(map(int, input("").split())) n list(map(int, input("").split())) list map(int, input("").split()) map int input("").split() ("").split ("") input "" split m a=[] a [] a.append(-1) a.append a append -1 for i in range(m):   
    a.append(int(input())) i range(m) range m a.append(int(input())) a.append a append int(input()) int input() input a.append(n+1) a.append a append n+1 n 1 out=1 out 1 c=10**9+7 c 10**9+7 10**9 10 9 7 for i in range(m+1):
    out*=int(fib(a[i+1]-a[i]))
    out%=c i range(m+1) range m+1 m 1 out*=int(fib(a[i+1]-a[i])) out int(fib(a[i+1]-a[i])) int fib(a[i+1]-a[i]) fib a[i+1]-a[i] a[i+1] a i+1 i 1 a[i] a i out%=c out c print(out) print out n,m = list(map(int, input("").split())) list(map(int, input("").split())) n m = list(map(int, input("").split())) list(map(int, input("").split())) m a=[] [] a def fib(q):
   fibonacci = [0,1]
   for i in range(2,q):
       fibonacci.append(fibonacci[i-2]+fibonacci[i-1])
   return fibonacci[q-1] def fib(q):
   fibonacci = [0,1]
   for i in range(2,q):
       fibonacci.append(fibonacci[i-2]+fibonacci[i-1])
   return fibonacci[q-1] fib out%=c c out c=10**9+7 10**9+7 c out*=int(fib(a[i+1]-a[i])) int(fib(a[i+1]-a[i])) out out=1 1 out
import math
def fib(q):
   fibonacci = [0,1]
   for i in range(2,q):
       fibonacci.append(fibonacci[i-2]+fibonacci[i-1])
   return fibonacci[q-1]
n,m = list(map(int, input("").split()))
a=[]
a.append(-1)
for i in range(m):   
    a.append(int(input()))
a.append(n+1)
out=1
c=10**9+7
for i in range(m+1):
    out*=int(fib(a[i+1]-a[i]))
    out%=c
print(out)