Buggy python submission (verdict: Time Limit Exceeded):
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product

def resolve():

    N,M=map(int,input().split())
    A=[int(input()) for i in range(M)]


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

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

    print(dp[N])

resolve()

Fixed submission:
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product

def resolve():

    N,M=map(int,input().split())
    A=[int(input()) for i in range(M)]


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

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

    print(dp[N])

resolve()

Buggy python submission (verdict: Time Limit Exceeded):
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product

def resolve():
    N, M = map(int,input().split())
    A = [int(input()) for _ in range(M)]


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

    for i in range(N):
        if not i+1 in A:
            dp[i + 1] = (dp[i]+dp[i+1])%(10**9+7)
        if i < N - 1 and not i+2 in A:
            dp[i + 2] = (dp[i]+dp[i+2])%(10**9+7)
    print(dp[N]%(10**9+7))



resolve()

Fixed submission:
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product

def resolve():

    N,M=map(int,input().split())
    A=[int(input()) for i in range(M)]


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

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

    print(dp[N])

resolve()

Buggy python submission (verdict: Time Limit Exceeded):
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product

def resolve():
    N, M = map(int,input().split())
    A = [int(input()) for _ in range(M)]


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

    for i in range(N):
        if not i+1 in A:
            dp[i + 1] += dp[i]%(10**9+7)
        if i < N - 1 and not i+2 in A:
            dp[i + 2] += dp[i]%(10**9+7)
    print(dp[N]%(10**9+7))



resolve()

Fixed submission:
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product

def resolve():

    N,M=map(int,input().split())
    A=[int(input()) for i in range(M)]


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

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

    print(dp[N])

resolve()

Buggy python submission (verdict: Time Limit Exceeded):
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product

def resolve():
    N, M = map(int,input().split())
    A = [int(input()) for _ in range(M)]


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

    for i in range(N):
        if not i+1 in A:
            dp[i + 1] += dp[i]%(10**9+7)
        if i < N - 1 and not i+2 in A:
            dp[i + 2] += dp[i]%(10**9+7)
    print(dp[N]%(10**9+7))



resolve()

Fixed submission:
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product

def resolve():

    N,M=map(int,input().split())
    A=[int(input()) for i in range(M)]


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

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

    print(dp[N])

resolve()

Buggy python submission (verdict: Time Limit Exceeded):
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product

def resolve():
    N, M = map(int,input().split())
    A = [int(input()) for _ in range(M)]


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

    for i in range(N):
        if not i+1 in A:
            dp[i + 1] += dp[i]
        if i < N - 1 and not i+2 in A:
            dp[i + 2] += dp[i]
    print(dp[N]%(10**9+7))



resolve()

Fixed submission:
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product

def resolve():

    N,M=map(int,input().split())
    A=[int(input()) for i in range(M)]


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

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

    print(dp[N])

resolve()