Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
dp=[0]*(n+1)
dp[0]=1
if 1 not in a:
  dp[1]=1
for i in range(n-1):
  if i+2 not in a:
    dp[i+2]=dp[i+1]+dp[i]
  else:
    dp[i+2]=0
print(dp[n]%(10**9+7))

Fixed submission:
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
dp=[1]*(n+1)
dp[0]=1
dp[1]=1
for i in range(m):
  if a[i]==1:
    dp[1]=0
  else:
    dp[a[i]]=0
for i in range(2,n+1):
  if dp[i]:
    dp[i]=dp[i-1]+dp[i-2]
print(dp[n]%(10**9+7))

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
dp=[0]*n
dp[0]=1
dp[1]=1
for i in range(2,n+1):
  dp[i]=dp[i-1]+dp[i-2]
print(dp[n]%(10**9+7))

Fixed submission:
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
dp=[1]*(n+1)
dp[0]=1
dp[1]=1
for i in range(m):
  if a[i]==1:
    dp[1]=0
  else:
    dp[a[i]]=0
for i in range(2,n+1):
  if dp[i]:
    dp[i]=dp[i-1]+dp[i-2]
print(dp[n]%(10**9+7))

Buggy python submission (verdict: Runtime Error):
def fib_memo(n):
    memo=["EMPTY"]*(n+1)
    def _fib(n):
        if n == 1:
            return 0
        elif n == 2:
            return 1
        elif memo[n] != "EMPTY":
            return memo[n]
        else:
            memo[n] = _fib(n-1)+_fib(n-2)
            return memo[n]
    return _fib(n)
def fib(n):
    f = ((1 + 5**0.5) / 2)**n / 5**0.5 + 0.5
    return int(f)
  
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
if a:
  cnt=fib(a[0]+1)*fib(n-a[m-1]+1)
  for i in range(1,m):
    cnt*=fib(a[i]-a[i-1])
  print(cnt%(10**9+7))
else:
  print(fib_memo(n+2)%(10**9+7))


Fixed submission:
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
dp=[1]*(n+1)
dp[0]=1
dp[1]=1
for i in range(m):
  if a[i]==1:
    dp[1]=0
  else:
    dp[a[i]]=0
for i in range(2,n+1):
  if dp[i]:
    dp[i]=dp[i-1]+dp[i-2]
print(dp[n]%(10**9+7))

Buggy python submission (verdict: Runtime Error):
def fib_memo(n):
    memo=["EMPTY"]*(n+1)
    def _fib(n):
        if n == 1:
            return 0
        elif n == 2:
            return 1
        elif memo[n] != "EMPTY":
            return memo[n]
        else:
            memo[n] = _fib(n-1)+_fib(n-2)
            return memo[n]
    return _fib(n)
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
if a:
  cnt=fib_memo(a[0]+1)*fib_memo(n-a[m-1]+1)
  for i in range(1,m):
    cnt*=fib_memo(a[i]-a[i-1])
  print(cnt%(10**9+7))
else:
  print(fib_memo(n+1))

Fixed submission:
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
dp=[1]*(n+1)
dp[0]=1
dp[1]=1
for i in range(m):
  if a[i]==1:
    dp[1]=0
  else:
    dp[a[i]]=0
for i in range(2,n+1):
  if dp[i]:
    dp[i]=dp[i-1]+dp[i-2]
print(dp[n]%(10**9+7))

Buggy python submission (verdict: Runtime Error):
def fib_memo(n):
    memo=["EMPTY"]*(n+1)
    def _fib(n):
        if n == 1:
            return 0
        elif n == 2:
            return 1
        elif memo[n] != "EMPTY":
            return memo[n]
        else:
            memo[n] = _fib(n-1)+_fib(n-2)
            return memo[n]
    return _fib(n)
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
cnt=fib_memo(a[0]+1)*fib_memo(n-a[m-1]+1)
for i in range(1,m):
  cnt*=fib_memo(a[i]-a[i-1])
print(cnt%(10**9+7))

Fixed submission:
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
dp=[1]*(n+1)
dp[0]=1
dp[1]=1
for i in range(m):
  if a[i]==1:
    dp[1]=0
  else:
    dp[a[i]]=0
for i in range(2,n+1):
  if dp[i]:
    dp[i]=dp[i-1]+dp[i-2]
print(dp[n]%(10**9+7))

Buggy python submission (verdict: Runtime Error):
def fib_memo(n):
    memo=["EMPTY"]*(n+1)
    def _fib(n):
        if n == 1:
            return 0
        elif n == 2:
            return 1
        elif memo[n] != "EMPTY":
            return memo[n]
        else:
            memo[n] = _fib(n-1)+_fib(n-2)
            return memo[n]
    return _fib(n)
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
cnt=fib_memo(a[0]-1)*fib_memo(n-a[m-1]-1)
for i in range(1,m-1):
  cnt*=fib_memo(a[i]-a[i-1]-1)
print(cnt)
  
  

Fixed submission:
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
dp=[1]*(n+1)
dp[0]=1
dp[1]=1
for i in range(m):
  if a[i]==1:
    dp[1]=0
  else:
    dp[a[i]]=0
for i in range(2,n+1):
  if dp[i]:
    dp[i]=dp[i-1]+dp[i-2]
print(dp[n]%(10**9+7))