#ABC129 C

N,M = map(int,input().split())
A = []
for i in range(M):
    a = int(input())
    A.append(a)

B = [1,2]
for i in range(N):
    B.append(B[i]+B[i+1])
    
C = [B[A[j]-A[j-1]-3] for j in range(1,M)]
print((sum(C)+B[A[0]-2]+B[N-A[M-1]-2])%(1000000007))
