
N, M = map(int,input().split())
a = []
dev = 100000007

for _ in range(M):
    aa = int(input())
    a.append(aa)

ans = 0
flag = True
a.append(N+1)

for i in range(M-1):
    if a[i+1] == a[i]+1:
        flag = False
        break

def fadd(n):
    if n == 1:
        return 1
    elif n == 2:
        return 2
    elif n == 0:
        return 0
    else:
        return fadd(n-1)%dev + fadd(n-2)%dev
    
if flag:
    
    pa = 0 
    for i,na in enumerate(a):
        print(i,na)
        ans += fadd(na - 1 - pa)%dev
        pa = na + 1

print(ans)