def dp(n):

    d=[0]*(n+1)

    if n==1:

        return 1

    else:

         d[0]=1

         if a[1]==0:

            d[1]=1

         else:

            d[1]=0

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

            if a[i]==0:

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

            else:

                d[i]=0

         return d[n]



n,m=list(map(int, input().split()))

a=[0]*(n+1)

for i in range(0,m):

    k=int(eval(input()))

    a[k]=1

print((dp(n)%1000000007))
def dp(n):

    d=[0]*(n+1)

    if n==1:

        return 1

    else:

         d[0]=1

         if a[1]==0:

            d[1]=1

         else:

            d[1]=0

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

            if a[i]==0:

                d[i]=(d[i-1]+d[i-2])%1000000007

            else:

                d[i]=0

         return d[n]



n,m=list(map(int, input().split()))

a=[0]*(n+1)

for i in range(0,m):

    k=int(eval(input()))

    a[k]=1

print((dp(n)))
def dp(n):
    d = [0] * (n + 1)
    if n == 1:
        return 1
    else:
        d[0] = 1
        if a[1] == 0:
            d[1] = 1
        else:
            d[1] = 0
        for i in range(2, n + 1):
            if a[i] == 0:
                d[i] = d[i - 1] + d[i - 2]
            else:
                d[i] = 0
        return d[n]


n, m = list(map(int, input().split()))
a = [0] * (n + 1)
for i in range(0, m):
    k = int(eval(input()))
    a[k] = 1
print((dp(n) % 1000000007))

def dp(n):
    d = [0] * (n + 1)
    if n == 1:
        return 1
    else:
        d[0] = 1
        if a[1] == 0:
            d[1] = 1
        else:
            d[1] = 0
        for i in range(2, n + 1):
            if a[i] == 0:
                d[i] = (d[i - 1] + d[i - 2]) % 1000000007
            else:
                d[i] = 0
        return d[n]


n, m = list(map(int, input().split()))
a = [0] * (n + 1)
for i in range(0, m):
    k = int(eval(input()))
    a[k] = 1
print((dp(n)))

-                d[i] = d[i - 1] + d[i - 2] +                d[i] = (d[i - 1] + d[i - 2]) % 1000000007 -print((dp(n) % 1000000007)) +print((dp(n)))