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

roots = 1
OUT = False

def fib(n):
    f = ((1 + 5**0.5) / 2)**n / 5**0.5 + 0.5
    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(roots%1000000007)





