CodeEff/ECCO huggingface dataset:
# Original solution
N, M = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(M)]
MOD = 10**9 + 7

dp = [0] * (N+1)
dp[0] = 1
dp[1] = 1 if 1 not in a else 0

for i in range(2, N+1):
    if i in a:
        continue
    dp[i] = (dp[i-1] + dp[i-2])
print((dp[N] % MOD))

# Optimized solution
N, M = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(M)]
MOD = 10**9 + 7
 
dp = [0] * (N+1)
dp[0] = 1
dp[1] = 1 if 1 not in a else 0
 
a = set(list(range(2,N+1))) - set(a)
for i in a:
    dp[i] = (dp[i-1] + dp[i-2]) % MOD
print((dp[N] % MOD))
# Original solution
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=sys.stdin.readline
def resolve():
    n,m=list(map(int,input().split()))
    fib=[0,1]
    a,b=0,1
    for _ in range(n):
        a,b=b,(a+b)%MOD
        fib.append(b)
    A=[-1]+[int(eval(input())) for _ in range(m)]+[n+1]
    ans=1
    for i in range(m+1):
        ans*=fib[A[i+1]-A[i]-1]%MOD
    print((ans%MOD))

resolve()

# Optimized solution
import sys
INF = 1 << 60
MOD = 10**9 + 7 # 998244353
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
def resolve():
    n, m = list(map(int, input().split()))
    S = set(int(eval(input())) for _ in range(m))

    a, b = 0, 1 # a[-1], a[0]
    for i in range(1, n + 1):
        if i in S:
            a, b = b, 0
        else:
            a, b = b, (a + b) % MOD

    print(b)
resolve()
# Original solution
import math
def cmb(n, r, mod, g1, g2):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

def main():
    N, M = list(map(int, input().split()))
    A = [-1] + [int(eval(input())) for i in range(M)] + [N + 1]

    mod = 10**9+7 #出力の制限
    N = 10**5
    g1 = [1, 1] # 元テーブル
    g2 = [1, 1] #逆元テーブル
    inverse = [0, 1] #逆元テーブル計算用テーブル
    for i in range( 2, N + 1 ):
        g1.append( ( g1[-1] * i ) % mod )
        inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
        g2.append( (g2[-1] * inverse[-1]) % mod )

    d = [0] * (len(A) - 1)
    for i in range(len(A) - 1):
        if A[i+1] - A[i] == 1:
            print((0))
            exit(0)
        d[i] = A[i+1] - 1 - (A[i] + 1)

    ans = 1
    for dd in d:
        if dd > 1:
            tmp = 0
            for j in range(dd//2 + 1):
                tmp += cmb(dd - j, j, mod, g1, g2)
            ans *= tmp

    print((ans % 1000000007))

if __name__ == '__main__':
    main()


# Optimized solution
def main():
    N, M = list(map(int, input().split()))
    A = [int(eval(input())) for i in range(M)] + [0]

    a = 0
    b = 1
    j = 0
    tmp = 0
    if N == 1:
        print((1))
    else:
        for i in range(1, N + 1):
            if A[j] == i:
                if tmp == 1:
                    print((0))
                    exit()
                tmp = 1
                j += 1
                a = 0
            else:
                if tmp == 1:
                    b = a + b
                    a = 0
                else:
                    c = a + b
                    a = b
                    b = c
                tmp = 0
        print((b % 1000000007))

if __name__ == '__main__':
    main()
# Original solution
N, M = list(map(int, input().split()))
mod = 10 ** 9 + 7
dp = [0] * (N+1)
dp[0] = 1
idx = 0
for m in range(M):
    a = int(eval(input()))
    for i in range(idx+1, a):
        dp[i] = dp[i-1] + dp[i-2]
        dp[i] %= mod
    idx = a

for i in range(idx+1, N+1):
    dp[i] = dp[i-1] + dp[i-2]
    dp[i] %= mod

print((dp[-1]))

# Optimized solution
N, M = list(map(int, input().split()))
mod = 10 ** 9 + 7
A = [True] * (N+1)
for _ in range(M):
    a = int(eval(input()))
    A[a] = False
dp = [0] * (N+1)
dp[:2] = 1, 1 if A[1] else 0
for i in range(2, N+1):
    if A[i]:
        dp[i] = dp[i-1] + dp[i-2]
        dp[i] %= mod
print((dp[N]))
# Original solution
N,M=list(map(int,input().split()))
A=[int(eval(input())) for i in range(M)]
if 1 in A:
    B=[1]+[0]*N
else:
    B=[1]+[1]+[0]*(N-1)
i=2
while i<=N:
    if i not in A:
        B[i] = (B[i - 1] + B[i - 2]) % (10 ** 9 + 7)
    i+=1
print((B[N]))

# Optimized solution
N,M=list(map(int,input().split()))
B=[1]+[1]+[0]*(N-1)
for j in range(M):
    a=int(eval(input()))
    B[a]=-1
    if a==1:
        B[a]=0
i=2
while i<=N:
    if B[i]==-1:
        B[i]=0
    else:
        B[i] = (B[i - 1] + B[i - 2]) % (10 ** 9 + 7)
    i+=1
print((B[N]))
# Original solution
n, m = list(map(int, input().split()))

if m > 0:
    aaa = [int(eval(input())) for i in range(m)]
else:
    aaa = set()

dp = [0] * (n + 1)
dp[0] = 1
dp[1] = 1 if 1 not in aaa else 0
MOD = 10 ** 9 + 7
 
for i in range(2, n + 1):
    if i in aaa:
        continue
    dp[i] = (dp[i - 2] + dp[i - 1]) % MOD
print((dp[n]))

# Optimized solution
import sys
input = sys.stdin.readline
 
n, m = list(map(int, input().split()))
s = set(map(int, [eval(input()) for _ in range(m)]))
MOD = 10 ** 9 + 7
a = 1 if not 0 in s else 0
b = 1 if not 1 in s else 0
for i in range(2, n + 1):
    if i in s:
        a, b = b, 0
    else:
        a, b = b, (a + b) % MOD
print(b)
# Original solution
n,m = list(map(int,input().split()))
c=10**9+7
a = [-1]
for i in range(1, m+1):
    a = a + [int(eval(input()))]
a =a+[n+1] 
for i in range(m+1):
    a[i]=a[i+1] - a[i]-1
b=[0]
b=b+[1]
for i in range(2, max(a)+1):
    b=b+[(b[i-1] + b[i-2])%c]
s=1
for i in range(m+1):
    s=(s*b[a[i]])%c
print(s)

# Optimized solution
n,m = list(map(int,input().split()))
c=10**9+7
a = [-1 for _ in range(m + 1)]
for i in range(1, m+1):
    a[i] = int(eval(input()))
a =a+[n+1] 
for i in range(m+1):
    a[i]=a[i+1] - a[i]-1
b=[0 for _ in range(max(a) + 1)]
b[1]=1
for i in range(2, max(a)+1):
    b[i] = (b[i-1] + b[i-2])%c
s=1
for i in range(m+1):
    s=(s*b[a[i]])%c
print(s)
# Original solution
N, M = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(M)]

class comb():
  F = [1, 1]
  Fi = [1, 1]
  I = [0, 1]
  def __init__(self, num, mod):
    self.MOD = mod
    for i in range(2, num + 1):
      self.F.append((self.F[-1] * i) % mod)
      self.I.append(mod - self.I[mod % i] * (mod // i) % mod)
      self.Fi.append(self.Fi[-1] * self.I[i] % mod)
  def com(self, n, k):
    if n < k: return 0
    if n < 0 or k < 0: return 0
    return self.F[n] * (self.Fi[k] * self.Fi[n - k] % self.MOD) % self.MOD


MOD = 10 ** 9 + 7

for i in range(1, M):
  if a[i] - a[i - 1] == 1:
    print((0))
    exit()

com = comb(200000, MOD)
ans = 1
x = 0
a = a + [N + 1]

for i in a:
  t = i - 1 - x
  at = 0
  for j in range(t // 2 + 1):
    k = t - j
    at = at + com.com(k, j) % MOD
  ans = ans * at % MOD
  x = i + 1
  

print(ans)

# Optimized solution
N, M = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(M)]
MOD = 10 ** 9 + 7
D = [0] * (N + 1)
D[0] = 1

a.append(10 ** 15)
c = 0
for i in range(1, N + 1):
  if a[c] == i:
    c += 1
    continue
  D[i] = D[i - 1]
  if i - 2 >= 0:
    D[i] = (D[i] + D[i - 2]) % MOD

print((D[-1]))
# Original solution
nm=list(map(int,input().split()))
n=nm[0]
m=nm[1]

inp=[]
if m==0:
    inp=[n+1]
    dis=[n+1]
else:
    for inpset in range(m):
        inp.append(int(eval(input())))
    

    dis=[max(inp[0],1)]
    p=0
    for i in inp[:-1]:
        dis.append(inp[p+1]-inp[p]-1)
        p+=1
    dis.append(max(n-inp[-1],1))
    #print (dis)

import math

def kaijo(x):
    ans=(math(100000)%1000000007)
    return ans

def combinations_count(n, r):
    return (math.factorial(n) // (math.factorial(n - r) * math.factorial(r)))%1000000007

def counting(x):
    if x==1:
        return 1
    else:
        
        res=0
        for a in range(x-1):
            if x-1-a>=a:
                res+=combinations_count(x-1-a,a)
                # print(x-1-a,a)
            else:
                break
        res=res%1000000007
        return res

if 0 in dis:
    print((0))
else:
    ans=1
    dis.sort()
    for d in dis:
        ans*=counting(d)
        ans=ans%1000000007
    print(ans)


# Optimized solution
nm=list(map(int,input().split()))
n=nm[0]
m=nm[1]

inp=[]
if m==0:
    inp=[n+1]
    dis=[n+1]
else:
    for inpset in range(m):
        inp.append(int(eval(input())))
    

    dis=[max(inp[0],1)]
    p=0
    for i in inp[:-1]:
        dis.append(inp[p+1]-inp[p]-1)
        p+=1
    dis.append(max(n-inp[-1],1))
    #print (dis)

def fib(x):
    a=0
    b=1
    for step in range(x):
        c=a+b
        a=b
        b=c
    return a


def counting(x):
    if x==1:
        return 1
    else:
        
        res=0
        for a in range(x-1):
            if x-1-a>=a:
                res+=combinations_count(x-1-a,a)
                # print(x-1-a,a)
            else:
                break
        res=res%1000000007
        return res

if 0 in dis:
    print((0))
else:
    ans=1
    dis.sort()
    for d in dis:
        ans*=fib(d)%1000000007
        ans=ans%1000000007
    print(ans)
# Original solution
n,m = list(map(int,input().split()))
a = [int(eval(input())) for i in range(m)]
mod = 10**9+7
dp = [0]*(n+1)
dp[0] = 1
j=0
for i in range(1,n+1):
  if i in a:
    #dp[a[j]] = 0 
    continue
  if i==1:
    dp[1] = dp[0]
    continue
  dp[i] = dp[i-1]+dp[i-2]
  dp[i]%=mod
print((dp[n]))

# Optimized solution
n,m = list(map(int,input().split()))
#a = [int(input()) for i in range(m)]
a=set()
for i in range(m):
    tmp=int(eval(input()))
    a.add(tmp)
mod = 10**9+7
dp = [0]*(n+1)
dp[0] = 1
j=0
for i in range(1,n+1):
  if i in a:
    #dp[a[j]] = 0 
    continue
  if i==1:
    dp[1] = dp[0]
    continue
  dp[i] = dp[i-1]+dp[i-2]
  dp[i]%=mod
print((dp[n]))
# Original solution
from functools import lru_cache
import sys
sys.setrecursionlimit(30000)

N, M = list(map(int, input().split()))
a = list(int(eval(input())) for _ in range(M))

MOD = pow(10, 9) + 7

isOk = True
for i in range(M-1):
    if a[i] + 1 == a[i+1]:
        isOk = False
    
funcb = [-1] * 100001
def func(n):
    if n <= 0:
        return 1
    cnt = funcb[n]
    if cnt > 0:
        return cnt
    cnt = 0
    if n >= 2:
        cnt += func(n-2)
    if n >= 1:
        cnt += func(n-1)
    funcb[n] = cnt % MOD
    return funcb[n]

func(30000)
func(50000)
func(80000)
func(100000)

if not isOk:
    print((0))
else:
    ans = 1
    s = 0
    for i in range(M+1):
        if i >= M:
            e = N
        else:
            e = a[i] - 1

        ans = ans * func(e-s) % MOD

        if i >= M:
            break

        s = a[i] + 1

    print(ans)


# Optimized solution
N, M = list(map(int, input().split()))
a = list(int(eval(input())) for _ in range(M))

MOD = pow(10, 9) + 7

MAP = [0] * (N + 1)

for x in a:
    MAP[x] = -1

MAP[0] = 1 
for i in range(N):
    if MAP[i] < 0:
        continue

    MAP[i] %= MOD
    if i + 1 <= N and MAP[i+1] >= 0:
        MAP[i+1] += MAP[i]
    if i + 2 <= N and MAP[i+2] >= 0:
        MAP[i+2] += MAP[i]

print((MAP[N] % MOD))
# Original solution
n,m = list(map(int,input().split()))
a = [int(eval(input())) for _ in range(m)]
for i in range(len(a)-1):
    if a[i+1] == a[i]+1:
        print((0))
        exit()
x = [0]*(n+1)
x[0]=1
div = 1000000007

if not 1 in a:
    x[1]=1

for i in range(2,n+1):
    if not i in a:
        x[i] = (x[i-2] + x[i-1]) % div
print((x[n]))

# Optimized solution
def Fib(n):
    a, b = 1, 1
    if n == 1:
        return a
    elif n == 2:
        return b
    else:
        for i in range(n-2):
            a, b = b, a + b
        return b

n,m = list(map(int,input().split()))
a = [int(eval(input())) for _ in range(m)]

for i in range(len(a)-1):
    if a[i+1] == a[i]+1:
        print((0))
        exit()
x = []
temp=0
for i in range(m):
    x.append(a[i]-temp-1)
    temp = a[i]+1
x.append(n-temp)

temp = 1
div = 1000000007

for i in x:
    temp = (temp*Fib(i+1))%div

print(temp)
# Original solution
mod = 10**9+7
N, M = list(map(int, input().split()))
A_ = [int(eval(input())) for _ in range(M)]
A = [0] * (N+1)
for a in A_:
    A[a] = 1
dp = [0] * (N+3)
dp[0] = 1
for i in range(1, N+1):
    if A[i-1] == 0:
        dp[i] += dp[i-1]
    if A[i-2] == 0:
        dp[i] += dp[i-2]
    dp[i] %= mod
print((dp[N]))


# Optimized solution
mod = 10**9+7
N, M = list(map(int, input().split()))
A_ = [int(eval(input())) for _ in range(M)]
A = [0] * (N+3)
for a in A_:
    A[a] = 1
dp = [0] * (N+3)
dp[0] = 1
for i in range(1, N+1):
    if A[i-1] == 0:
        dp[i] += dp[i-1]
    if A[i-2] == 0:
        dp[i] += dp[i-2]
    dp[i] %= mod
print((dp[N]))
# Original solution
N,M=list(map(int,input().split()))
A=[int(eval(input())) for _ in range(M)]
n1,n2=0,1
for i in range(1,N+1):
    if i in A:
        n1=n2
        n2=0
    else:
        tmp=n2
        n2=(n1+n2)%1000000007
        n1=tmp
print(n2)

# Optimized solution
N,M=list(map(int,input().split()))
A=[int(eval(input())) for _ in range(M)]
ai=0
n1,n2=0,1
for i in range(1,N+1):
    if ai<M and i==A[ai]:
        ai+=1
        n1=n2
        n2=0
    else:
        tmp=n2
        n2=(n1+n2)%1000000007
        n1=tmp
print(n2)
# Original solution
import sys
mod = 10**9+7
def main():
    n,m=list(map(int,input().split(' ')))
    if m > 0:
        aaa = set(map(int,sys.stdin))
    else:
        aaa = set()

    dp = [0] * (n+1)
    dp[0] = 1
    dp[1] = 1 if 1 not in aaa else 0
    for i in range(2,n+1):
        if i in aaa:
            continue
        dp[i] = dp[i-1]+dp[i-2]

    print((dp[n]%mod))

main()

# Optimized solution
import sys
mod = 10**9+7
def main():
    n,m=list(map(int,input().split(' ')))
    if m > 0:
        aaa = set(map(int,sys.stdin))
    else:
        aaa = set()

    dp = [0] * (n+1)
    dp[0] = 1
    dp[1] = 1 if 1 not in aaa else 0
    for i in range(2,n+1):
        if i in aaa:
            continue
        dp[i] = (dp[i-1]+dp[i-2])%mod

    print((dp[n]))

main()
# Original solution
n,m=list(map(int,input().split()))
a=[int(eval(input())) for _ in range(m)]
b=[(True if i in a else False) for i in range(n+1)]
fib=[0]*(n+1)
fib[0]=1
fib[1]=[1,0][b[1]]
for i in range(2,n+1):
  fib[i]=[fib[i-1]+fib[i-2],0][b[i]]
  fib[i]%=10**9+7
print((fib[n]))

# Optimized solution
n,m=list(map(int,input().split()))
mod=10**9+7
a=[False]*(n+1)
for i in range(m):
  a[int(eval(input()))]=True
fib=[0]*(n+1)
fib[0]=1
fib[1]=[1,0][a[1]]
for i in range(2,n+1):
  if a[i]:
    fib[i]=0
  else:
    fib[i]=(fib[i-1]+fib[i-2])%mod
print((fib[n]))
# Original solution
n, m = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(m)]
m = 10**9+7

dp = [0 for _ in range(n+1)]
dp[0] = 1
dp[1] = 1
if 1 in a:
  dp[1] = 0

for i in range(2, n+1):
  dp[i] = 0 if i in a else (dp[i-2] + dp[i-1]) % m

print((dp[-1]))


# Optimized solution
n, m = list(map(int, input().split()))
a = set(int(eval(input())) for _ in range(m))
m = 10**9+7

dp = [0 for _ in range(n+1)]
dp[0] = 1
dp[1] = 1
if 1 in a:
  dp[1] = 0

for i in range(2, n+1):
  dp[i] = 0 if i in a else (dp[i-2] + dp[i-1]) % m

print((dp[-1]))
# Original solution
n, m = list(map(int, input().split()))
a = set(int(eval(input())) for _ in range(m))
m = 10**9+7

dp = [0 for _ in range(n+1)]
dp[0] = 1
dp[1] = 1
if 1 in a:
  dp[1] = 0

for i in range(2, n+1):
  dp[i] = 0 if i in a else (dp[i-2] + dp[i-1]) % m

print((dp[-1]))


# Optimized solution
n, m = list(map(int, input().split()))
P = 10**9+7

dp = [-1 for _ in range(n+1)]
dp[0] = 1
dp[1] = 1
for _ in range(m):
  dp[int(eval(input()))] = 0

for i in range(2, n+1):
  if not dp[i] == 0:
    dp[i] = (dp[i-2] + dp[i-1]) % P

print((dp[-1]))
# Original solution
n,m = list(map(int,input().split()))
o = [int(eval(input())) for _ in range(m)]
#print(o)
mod = (10**9)+7
dp = [1]+[0]*(n)

for i in range(1,n+1):
  dp[i] = (dp[i-1]+dp[i-2])%mod
  if i in o:
    dp[i] = 0
  #print(i,dp)
#print(dp)
print((dp[-1]))


# Optimized solution
n,m = list(map(int,input().split()))
o = set(int(eval(input())) for _ in range(m))
#print(o)
mod = (10**9)+7
dp = [0]*(n+1)
dp[0] = 1

for i in range(1,n+1):
  dp[i] = (dp[i-1]+dp[i-2])%mod
  if i in o:
    dp[i] = 0
  #print(i,dp)
#print(dp)
print((dp[-1]))
# Original solution
n,m = list(map(int,input().split()))
o = set(int(eval(input())) for _ in range(m))
#print(o)
mod = (10**9)+7
dp = [0]*(n+1)
dp[0] = 1

for i in range(1,n+1):
  dp[i] = (dp[i-1]+dp[i-2])%mod
  if i in o:
    dp[i] = 0
  #print(i,dp)
#print(dp)
print((dp[-1]))


# Optimized solution
n,m = list(map(int,input().split()))
a = set([int(eval(input())) for _ in range(m)])
#print(a)
mod = 10**9+7
dp = [0]*(n+1)
dp[0] = 1
for i in range(1,n+1):
  dp[i] = (dp[i-1]+dp[i-2])%mod
  if i in a:
    dp[i] = 0
print((dp[-1]))
# Original solution
def main():
    N, M = list(map(int, input().split()))
    a = [0] * (1 + 10 ** 5)
    for _ in range(M):
        a[int(eval(input()))] = 1
    dp = [0] * (N + 1)
    dp[0] = 1
    if not a[1]:
        dp[1] = 1

    for i in range(2, N + 1):
        if not a[i]:
            dp[i] += dp[i-1] + dp[i-2]
            dp[i] %= 1000000007

    print((dp[N]))

main()


# Optimized solution
def main():
    import sys
    input = sys.stdin.readline
    N, M = list(map(int, input().split()))
    a = [0] * (1 + 10 ** 5)
    for _ in range(M):
        a[int(eval(input()))] = 1
    dp = [0] * (N + 1)
    dp[0] = 1
    if not a[1]:
        dp[1] = 1

    for i in range(2, N + 1):
        if not a[i]:
            dp[i] += dp[i-1] + dp[i-2]
            dp[i] %= 1000000007

    print((dp[N]))

main()
# Original solution
MOD = 10**9+7
n, m = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(m)]
dp = [0] * (n+1)
dp[0] = 1
for i in range(1, n+1):
    if i not in a:
        dp[i] = (dp[i-1] + dp[i-2]) % MOD
print((dp[n]))


# Optimized solution
MOD = 10**9+7
n, m = list(map(int, input().split()))
A = [int(eval(input())) for _ in range(m)]

safe = [True] * (n+1)
for a in A:
    safe[a] = False

dp = [0] * (n+1)
dp[0] = 1
for i in range(1, n+1):
    if safe[i]:
        dp[i] = (dp[i-1] + dp[i-2]) % MOD

print((dp[n]))
# Original solution
MOD = 10**9+7
n, m = list(map(int, input().split()))
A = [int(eval(input())) for _ in range(m)]

safe = [True] * (n+1)
for a in A:
    safe[a] = False

dp = [0] * (n+1)
dp[0] = 1
for i in range(1, n+1):
    if safe[i]:
        dp[i] = (dp[i-1] + dp[i-2]) % MOD

print((dp[n]))


# Optimized solution
MOD = 10**9+7
n, m = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(m)]
a = set(a)
dp = [0] * (n+1)
dp[0] = 1
for i in range(1, n+1):
    if i not in a:
        dp[i] = (dp[i-1] + dp[i-2]) % MOD
print((dp[n]))
# Original solution
N, M = list(map(int, input().split()))

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


dp   = [0]*(N+1)
dp[0] = 1

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

    if i+1 == 1 and not (i+1) in A:
        dp[i+1] = dp[i]
    elif not (i+1 in A) and not(i in A) and not(i-1 in A):
        dp[i+1] = dp[i] + dp[i-1] 
    elif not(i+1 in A) and not (i in A) and (i-1 in A):
        dp[i+1] = dp[i]
    elif not(i+1 in A) and (i in A) and not(i-1 in A):
        dp[i+1] = dp[i-1] 

print((dp[N]%1000000007))


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

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


dp   = [0]*(N+1)
dp[0] = 1

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

    if i+1 == 1 and not (i+1) in A:
        dp[i+1] = dp[i]
    elif not (i+1 in A) and not(i in A) and not(i-1 in A):
        dp[i+1] = dp[i] + dp[i-1] 
    elif not(i+1 in A) and not (i in A) and (i-1 in A):
        dp[i+1] = dp[i]
    elif not(i+1 in A) and (i in A) and not(i-1 in A):
        dp[i+1] = dp[i-1] 

print((dp[N]%1000000007))
# Original solution
MOD = 10**9+7

n,m = list(map(int, input().split()))
al = [True]*(n+1)
for _ in range(m):
    al[int(eval(input()))] = False

dp = [0]*(n+1) 
dp[0] = 1
for i in range(n):
    if i+2 <= n and al[i+2]:
        dp[i+2] += dp[i]
    if i+1 <= n and al[i+1]:
        dp[i+1] += dp[i]

print((dp[n]%MOD))

# Optimized solution
n,m = list(map(int, input().split()))
al = [True]*(n+1)
for _ in range(m):
    a = int(eval(input()))
    al[a] = False

MOD = 10**9+7
dp = [0]*(n+1)
dp[0] = 1
for i in range(n):
    if i+1 <= n and al[i+1]:
        dp[i+1] += dp[i]
        dp[i+1]%=MOD
    if i+2 <= n and al[i+2]:
        dp[i+2] += dp[i]
        dp[i+2]%=MOD

print((dp[n]))
# Original solution
N,M = list(map(int,input().split()))
a = [int(eval(input())) for i in range(M)]

dp = [0]*(N+1)
dp[0] = 1

if 1 in a:
    dp[1] = 0
else:
    dp[1] = 1

for i in range(2,N+1):
    if i in a:
        continue
    dp[i] = dp[i-2] + dp[i-1]
    dp[i] = dp[i] % (10**9+7)

print((dp[N]))


# Optimized solution
N,M = list(map(int,input().split()))
a = [int(eval(input())) for i in range(M)]

dp = [-float("inf")]*(N+1)
dp[0] = 1
dp[1] = 1

for i in a:
    dp[i] = 0

for i in range(2,N+1):
    if dp[i] == 0:
        continue
    dp[i] = dp[i-2] + dp[i-1]
    dp[i] = dp[i] % (10**9+7)

print((dp[N]))
# Original solution
import sys

sys.setrecursionlimit(2147483647)
INF = float("inf")
MOD = 1000000007

a=open(0)
N,_,*a = list(map(int, a.read().split()))

dp = [-1 for _ in range(100010)]
dp[0] = 0
for i in a: dp[i] = 0
def rec(i):
    if dp[i] > -1:
        return dp[i]
    if i<3:
        dp[i] = rec(i-1) + 1
        return dp[i]
    dp[i] = (rec(i-1)+rec(i-2))%MOD
    return dp[i]
    
print((rec(N)))






# Optimized solution
MOD=10**9+7

N,_,*a = list(map(int, open(0).read().split()))
A=set(a)
dp = [0 for _ in range(N+1)]
dp[:2] = 1, 0 if 1 in A else 1
for i in range(2,N+1):
    if i not in A:
        dp[i]=(dp[i-1]+dp[i-2])%MOD
    
print((dp[N]))
# Original solution
n,m = list(map(int,input().split()))
para = [int(eval(input())) for i in range(m)]
mod = 10**9+7
dp = [0]*(n+1)
for i in range(n+1):
    if  i not in para :
        if i == 1 or i==0:
            dp[i] = 1
        else:
            dp[i] = (dp[i-1] + dp[i-2])%mod
    else :
        dp[i] = 0


print(("{}".format(dp[-1])))

# Optimized solution
n,m = list(map(int,input().split()))
para = [int(eval(input())) for i in range(m)]
mod = 10**9+7
dp = [-1]*(n+1)
for i in para:
    dp[i] = 0
for i in range(n+1):
    if  dp[i] != 0 :
        if i == 1 or i==0:
            dp[i] = 1
        else:
            dp[i] = (dp[i-1] + dp[i-2])%mod



print(("{}".format(dp[-1])))
# Original solution
n, m = list(map(int, input().split()))
broken = []
for i in range(m):
    broken.append(int(eval(input())))
MOD = 10 ** 9 + 7
dp = [0] * (n+1)
dp[0] = 1
if 1 not in broken:
    dp[1] = 1
for i in range(2, n+1):
    if i not in broken:
        dp[i] = (dp[i-1] + dp[i-2])%MOD

print((dp[-1]))

# Optimized solution
# ABC129C - Typical Stairs
import sys
input = sys.stdin.readline
 
def main():
    N, M = tuple(map(int, input().split()))
    A = set(map(int, [eval(input()) for _ in range(M)]))
    MOD = 10 ** 9 + 7
    dp = [0] * (N + 1)
    dp[:2] = 1, 1 if 1 not in A else 0
    for i in range(2, N + 1):
        if i in A:
            continue
        else:
            dp[i] = (dp[i - 1] + dp[i - 2]) % MOD
    print((dp[-1]))
 
 
if __name__ == "__main__":
    main()
# Original solution
N, M = list(map(int, input().split()))
A = [int(eval(input())) for _ in range(M)]
mod = 10 ** 9 + 7

dp = [0] * (N + 1)
dp[0] = 1

for i in range(N):
    if i + 1 not in A:
        dp[i + 1] += dp[i]
    if i + 2 <= N and i + 2 not in A:
        dp[i + 2] += dp[i]

print((dp[N] % mod))
# print(dp)


# Optimized solution
N, M = list(map(int, input().split()))
A = [int(eval(input())) for _ in range(M)]
mod = 10 ** 9 + 7

dp = [0] * (N + 1)
dp[0] = 1
for a in A:
    dp[a] = -1

for i in range(N):
    if dp[i] >= 0:
        if dp[i + 1] >= 0:
            dp[i + 1] += dp[i]
        if i + 2 <= N and dp[i + 2] >= 0:
            dp[i + 2] += dp[i]

print((dp[N] % mod))
# print(dp)
# Original solution
N, M = list(map(int, input().split(' ')))
P = 1000000007

skip = []
for i in range(M):
    skip.append(int(input()))


steps = [0] * (N + 2)
steps[0] = 1

for i in range(0, N):
    if i+1 not in skip:
        steps[i+1] += steps[i]
        steps[i+1] %= P

    if i+2 not in skip:
        steps[i+2] += steps[i]
        steps[i+2] %= P

print(steps[N])


# Optimized solution
N, M = list(map(int, input().split(' ')))
P = 1000000007

skip = []
for i in range(M):
    skip.append(int(input()))

nums = set(range(N)) - set(skip)

steps = [0] * (N + 2)
steps[0] = 1

for i in nums:
    steps[i+1] = (steps[i+1] + steps[i]) % P
    steps[i+2] = (steps[i+2] + steps[i]) % P

print(steps[N])