# PROXY

import math
N, M = [int(i) for i in input().split()]
list = i = [int(input()) for i in range(M)]
Nlist = []
counter = 1
while counter < M:
    Diff_id = list[counter] - list[counter - 1]
    Nlist.append(Diff_id - 2 if Diff_id != 1 else -1)
    counter += 1
Nlist.insert(0,list[0] -1 if list[0] - 1 != 0 else 1)
Nlist.insert(M,N - list[M - 1] - 1 if N - list[M - 1] - 1 != 0 else 1)
counter = 0
ANSER = 1
while counter <= M:
    SQ5 = math.sqrt(5)
    P = ((1 + SQ5) / 2)**(Nlist[counter] + 1)
    Q = ((1 - SQ5) / 2)**(Nlist[counter] + 1)
    HowMany = math.floor((P - Q ) / SQ5)
    ANSER *= HowMany
    counter += 1
print(ANSER % (10**9 + 7))