import sys
sys.setrecursionlimit(5000)
N,M = map(int,input().split())
def stair(N):
    if(N <0):
        return 0
    if(N == 0):
        return 1
    elif(N == 1):
        return 1
    elif(N == 2):
        return 2
    else:
        return stair(N-1)+stair(N-2)
ans = 1
a = 0
mod = 10**9+7
for i in range(M):
    b = int(input())
    b -=1
    ans = ans*stair(b-a)%mod
    a = b+2
ans = ans*stair(N-a)%mod
print(ans)