def fib(n):

    if n==1:

        ans=[1]

        return ans



    ans=[1,1]

    cnt=2

    while cnt <n:

        ans.append(ans[-2]+ans[-1])

        cnt+=1

    return ans



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



mod=10**9+7



if N==1:

    print((1))

    exit()



a0=-1

ans=1

for i in range(M):

    a=int(eval(input()))

    n=(a-1)-(a0+1)

    if a-a0==1:

        print((0))

        exit()

    c=fib(n+1)[-1]

    ans=(ans*c)%mod

    a0=a



a = N+1

n = (a - 1) - (a0 + 1)

c = fib(n+1)[-1]

ans=(ans*c)%mod



print(ans)





def fib(n):

    if n==1:

        a=1

        return a

    if n==2:

        a=1

        return a

    a0=1

    a1=1

    cnt=2

    while cnt <n:

        a=a0+a1

        cnt+=1

        a0=a1

        a1=a

    return a





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



mod=10**9+7



if N==1:

    print((1))

    exit()



a0=-1

ans=1

for i in range(M):

    a=int(eval(input()))

    n=(a-1)-(a0+1)

    if a-a0==1:

        print((0))

        exit()

    c=fib(n+1)

    ans=(ans*c)%mod

    a0=a



a = N+1

n = (a - 1) - (a0 + 1)

c = fib(n+1)

ans=(ans*c)%mod



print(ans)





def fib(n):
    if n == 1:
        ans = [1]
        return ans
    ans = [1, 1]
    cnt = 2
    while cnt < n:
        ans.append(ans[-2] + ans[-1])
        cnt += 1
    return ans


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

def fib(n):
    if n == 1:
        a = 1
        return a
    if n == 2:
        a = 1
        return a
    a0 = 1
    a1 = 1
    cnt = 2
    while cnt < n:
        a = a0 + a1
        cnt += 1
        a0 = a1
        a1 = a
    return a


N, M = list(map(int, input().split()))
mod = 10**9 + 7
if N == 1:
    print((1))
    exit()
a0 = -1
ans = 1
for i in range(M):
    a = int(eval(input()))
    n = (a - 1) - (a0 + 1)
    if a - a0 == 1:
        print((0))
        exit()
    c = fib(n + 1)
    ans = (ans * c) % mod
    a0 = a
a = N + 1
n = (a - 1) - (a0 + 1)
c = fib(n + 1)
ans = (ans * c) % mod
print(ans)

-        ans = [1] -        return ans -    ans = [1, 1] +        a = 1 +        return a +    if n == 2: +        a = 1 +        return a +    a0 = 1 +    a1 = 1 -        ans.append(ans[-2] + ans[-1]) +        a = a0 + a1 -    return ans +        a0 = a1 +        a1 = a +    return a -    c = fib(n + 1)[-1] +    c = fib(n + 1) -c = fib(n + 1)[-1] +c = fib(n + 1)