Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
def main():
    N, M = map(int, input().split())
    a = []
    for i in range(M):
        a.append(int(input()))
    
    #print("a", a)
    
    dp = ([0] * N)
    dp.append(1)
    dp.append(0)
    mod = 1000000007
    
    for s in reversed(range(N)):
        if s in a: # xだったら
            if s+1 in a:
                dp[s] = 0 # 2回連続で穴があったら0返して終了
                break
            else:
                dp[s] = 0 # 無を代入
        else: # oだったら
            dp[s] = (dp[s+1] + dp[s+2]) % mod # DP!! DP!!
            
    print(dp[0])

main()

Fixed submission:
# coding: utf-8
def main():
    N, M = map(int, input().split())

    a = [True] * (N+1)
    #s = [True for _ in range(N+1)]
    for _ in range(M):
        a[int(input())] = False
    #print(a)
    
    #a = []
    #for i in range(M):
    #    a.append(int(input()))
    
    dp = [0] * (N)
    dp.append(1)
    dp.append(0)
    mod = 10**9 + 7
    
    for s in reversed(range(N)):
        if a[s] == False: # xだったら
            if a[s+1] == False:
                dp[s] = 0 # 2回連続で穴があったら0返して終了
                break
            else:
                dp[s] = 0 # 無を代入
        else: # oだったら
            dp[s] = (dp[s+1] + dp[s+2]) % mod # DP!! DP!!
            
    print(dp[0])

main()

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
N, M = map(int, input().split())
a = []
for i in range(M):
    a.append(int(input()))

#print("a", a)

dp = ([0] * N)
dp.append(1)
dp.append(0)
mod = 1000000007

for s in reversed(range(N)):
    if s in a: # xだったら
        if s+1 in a:
            dp[s] = 0 # 2回連続で穴があったら0返して終了
            break
        else:
            dp[s] = 0 # 無を代入
    else: # oだったら
        dp[s] = (dp[s+1] + dp[s+2]) % mod # DP!! DP!!
        
print(dp[0])


Fixed submission:
# coding: utf-8
def main():
    N, M = map(int, input().split())

    a = [True] * (N+1)
    #s = [True for _ in range(N+1)]
    for _ in range(M):
        a[int(input())] = False
    #print(a)
    
    #a = []
    #for i in range(M):
    #    a.append(int(input()))
    
    dp = [0] * (N)
    dp.append(1)
    dp.append(0)
    mod = 10**9 + 7
    
    for s in reversed(range(N)):
        if a[s] == False: # xだったら
            if a[s+1] == False:
                dp[s] = 0 # 2回連続で穴があったら0返して終了
                break
            else:
                dp[s] = 0 # 無を代入
        else: # oだったら
            dp[s] = (dp[s+1] + dp[s+2]) % mod # DP!! DP!!
            
    print(dp[0])

main()

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
N, M = map(int, input().split())
a = []
for i in range(M):
    a.append(int(input()))

#print("a", a)

dp = [1, 0]
mod = 1000000007

for s in reversed(range(N)):
    if s in a: # xだったら
        if s+1 in a:
            dp[0] = 0 # 2回連続で穴があったら
            break
        else:
            dp.insert(0, 0) # 無を代入
        #continue
    else: # oだったら
        t = (dp[0] + dp[1]) % mod # DP!! DP!!
        dp.insert(0, t)
        
print(dp[0])


Fixed submission:
# coding: utf-8
def main():
    N, M = map(int, input().split())

    a = [True] * (N+1)
    #s = [True for _ in range(N+1)]
    for _ in range(M):
        a[int(input())] = False
    #print(a)
    
    #a = []
    #for i in range(M):
    #    a.append(int(input()))
    
    dp = [0] * (N)
    dp.append(1)
    dp.append(0)
    mod = 10**9 + 7
    
    for s in reversed(range(N)):
        if a[s] == False: # xだったら
            if a[s+1] == False:
                dp[s] = 0 # 2回連続で穴があったら0返して終了
                break
            else:
                dp[s] = 0 # 無を代入
        else: # oだったら
            dp[s] = (dp[s+1] + dp[s+2]) % mod # DP!! DP!!
            
    print(dp[0])

main()

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
N, M = map(int, input().split())
a = []
for i in range(M):
    a.append(int(input()))
a.append(N+1)
a.append(N+2)
#print("a", a)

dp = [1, 0]
#s = 0
mod = 1000000007

for s in reversed(range(N)):
    if s in a: # xだったら
        dp.insert(0, 0) # 無を代入
        #continue
    else: # oだったら
        t = (dp[0] + dp[1]) % mod
        dp.insert(0, t)
        
print(dp[0])


Fixed submission:
# coding: utf-8
def main():
    N, M = map(int, input().split())

    a = [True] * (N+1)
    #s = [True for _ in range(N+1)]
    for _ in range(M):
        a[int(input())] = False
    #print(a)
    
    #a = []
    #for i in range(M):
    #    a.append(int(input()))
    
    dp = [0] * (N)
    dp.append(1)
    dp.append(0)
    mod = 10**9 + 7
    
    for s in reversed(range(N)):
        if a[s] == False: # xだったら
            if a[s+1] == False:
                dp[s] = 0 # 2回連続で穴があったら0返して終了
                break
            else:
                dp[s] = 0 # 無を代入
        else: # oだったら
            dp[s] = (dp[s+1] + dp[s+2]) % mod # DP!! DP!!
            
    print(dp[0])

main()

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
N, M = map(int, input().split())
a = []
for i in range(M):
    a.append(int(input()))
a.append(N+1)
a.append(N+2)
#print("a", a)

dp = [1, 0]
#s = 0
mod = 1000000007

for s in reversed(range(N)):
    if s in a: # xだったら
        dp.insert(0, 0) # 無を代入
        #continue
    else: # oだったら
        t = (dp[0] + dp[1]) % mod
        dp.insert(0, t)
        
print(dp[0])


Fixed submission:
# coding: utf-8
def main():
    N, M = map(int, input().split())

    a = [True] * (N+1)
    #s = [True for _ in range(N+1)]
    for _ in range(M):
        a[int(input())] = False
    #print(a)
    
    #a = []
    #for i in range(M):
    #    a.append(int(input()))
    
    dp = [0] * (N)
    dp.append(1)
    dp.append(0)
    mod = 10**9 + 7
    
    for s in reversed(range(N)):
        if a[s] == False: # xだったら
            if a[s+1] == False:
                dp[s] = 0 # 2回連続で穴があったら0返して終了
                break
            else:
                dp[s] = 0 # 無を代入
        else: # oだったら
            dp[s] = (dp[s+1] + dp[s+2]) % mod # DP!! DP!!
            
    print(dp[0])

main()