NM= list(map(int, input().split()))
A = [int(input()) for i in range(NM[1])]

roots = 1
OUT = False

def fib(n):
    if n == 0:
        return 0
    if n == 1 or n == 2:
        return 1
    else:
        f = fib(n-1)+fib(n-2)
        return int(f)



for j in range(len(A)):
    #keynum 1 ブロックに1つ，飛ぶしかないのでスルー keynum 0 ブロックに0，問答無用で全体0通り
    keynum = 1

    if j == 0:
        keynum = A[j]
    else:
        keynum = A[j] - (A[j-1]+1)


    if keynum == 0:
        roots = 0
        OUT = True
        break
    elif keynum == 1 or keynum == 2:
        continue
    else:
        roots *= fib(keynum)


lastkeynum = NM[0]+1 - (A[-1]+1)
# print(lastkeynum)
if lastkeynum == 0:
    roots = 0
elif lastkeynum == 1 or lastkeynum == 2:
    roots = roots
else:
    roots *= fib(lastkeynum)


if OUT:
    roots = 0

print(int(roots%1000000007))
# print(int(fib(94)%1000000007))


# #解答例
# n,m=map(int,input().split())
# A=set(int(input()) for i in range(m))
# dp=[0]*(n+1)
# dp[0]=1
# for i in range(1,n+1):
#     # print("i {}, dp {}".format(i,dp[i-2]))
#     dp[i]=(dp[i-1]+dp[i-2])%(10**9+7)
#     if i in A:dp[i]=0
# print(dp[n])




