N,M=list(map(int,input().split()))

a = [int(eval(input())) for _ in range(M)]

a.append(N+1)

mod=10**9+7



fib=[1]*(N+1)

for i in range(2,N+1):

    fib[i]=fib[i-1]+fib[i-2]

fib.append(0)



ans=fib[a[0]-1]

for i in range(M):

    ans*=fib[a[i+1]-a[i]-2]

    ans%=mod

print((ans%mod))
import sys

input = sys.stdin.readline



def I(): return int(eval(input()))

def MI(): return list(map(int, input().split()))

def LI(): return list(map(int, input().split()))



def main():

    mod=10**9+7

    N,M=MI()

    dp=[0]*(N+1)

    dp[0]=1

    a=[0]*M

    for i in range(M):

        a[i]=I()

        

    a.append(10**6)

    cur=0#aの場所

    

    for i in range(1,N+1):

        if i==a[cur]:

            cur+=1

        else:

            dp[i]=(dp[i-1]+dp[i-2])%mod

            

    print((dp[-1]))

    



main()

N, M = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(M)]
a.append(N + 1)
mod = 10**9 + 7
fib = [1] * (N + 1)
for i in range(2, N + 1):
    fib[i] = fib[i - 1] + fib[i - 2]
fib.append(0)
ans = fib[a[0] - 1]
for i in range(M):
    ans *= fib[a[i + 1] - a[i] - 2]
    ans %= mod
print((ans % mod))

import sys

input = sys.stdin.readline


def I():
    return int(eval(input()))


def MI():
    return list(map(int, input().split()))


def LI():
    return list(map(int, input().split()))


def main():
    mod = 10**9 + 7
    N, M = MI()
    dp = [0] * (N + 1)
    dp[0] = 1
    a = [0] * M
    for i in range(M):
        a[i] = I()
    a.append(10**6)
    cur = 0  # aの場所
    for i in range(1, N + 1):
        if i == a[cur]:
            cur += 1
        else:
            dp[i] = (dp[i - 1] + dp[i - 2]) % mod
    print((dp[-1]))


main()

-N, M = list(map(int, input().split())) -a = [int(eval(input())) for _ in range(M)] -a.append(N + 1) -mod = 10**9 + 7 -fib = [1] * (N + 1) -for i in range(2, N + 1): -    fib[i] = fib[i - 1] + fib[i - 2] -fib.append(0) -ans = fib[a[0] - 1] -for i in range(M): -    ans *= fib[a[i + 1] - a[i] - 2] -    ans %= mod -print((ans % mod)) +import sys + +input = sys.stdin.readline + + +def I(): +    return int(eval(input())) + + +def MI(): +    return list(map(int, input().split())) + + +def LI(): +    return list(map(int, input().split())) + + +def main(): +    mod = 10**9 + 7 +    N, M = MI() +    dp = [0] * (N + 1) +    dp[0] = 1 +    a = [0] * M +    for i in range(M): +        a[i] = I() +    a.append(10**6) +    cur = 0  # aの場所 +    for i in range(1, N + 1): +        if i == a[cur]: +            cur += 1 +        else: +            dp[i] = (dp[i - 1] + dp[i - 2]) % mod +    print((dp[-1])) + + +main()