Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
import numpy as np

H, W = map(int, input().split())
S = np.array([list(input()) for _ in range(H)]) == '.'
ups = np.zeros((H,W), dtype=int)
downs = np.zeros((H,W), dtype=int)
lefts = np.zeros((H,W), dtype=int)
rights = np.zeros((H,W), dtype=int)

for h in range(H):
    ups[h] = (ups[h-1] + 1) * S[h-1]
    downs[H-h-1] = (downs[H-h-1] + 1) * S[H-h-1]
for w in range(W):
    lefts[:, w] = (lefts[:, w-1] + 1) * S[w-1]
    rights[:, W-w-1] = (rights[:, W-w-1] + 1) * S[W-w-1]
print(np.amax((ups+downs+lefts+rights)*S)+1)


Fixed submission:
from collections import deque
N, M = map(int, input().split())
A = deque()
[A.append(int(input())) for _ in range(M)]

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

for i in range(N+1):
    if A:
        a = A[0]
    else:
        a = 0
    if len(A) >= 2:
        b = A[1]
    else:
        b = 0

    dp[i] = dp[i] % (10**9 + 7)
    if not i+1 == a:
        dp[i+1] += dp[i]
    else:
        A.popleft()
    if not i+2 == b and not i+2 == a:
        dp[i+2] += dp[i]
print(dp[N])

Buggy python submission (verdict: Runtime Error):
from collections import deque
N, M = map(int, input().split())
A = deque()
[A.append(int(input())) for _ in range(M)]

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

for i in range(N+1):
    if A:
        a = A[0]
    if len(A) >= 2:
        b = A[1]

    dp[i] = dp[i] % (10**9 + 7)
    if not i+1 == a:
        dp[i+1] += dp[i]
    else:
        A.popleft()
    if not i+2 == b and not i+2 == a:
        dp[i+2] += dp[i]
print(dp[N])


Fixed submission:
from collections import deque
N, M = map(int, input().split())
A = deque()
[A.append(int(input())) for _ in range(M)]

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

for i in range(N+1):
    if A:
        a = A[0]
    else:
        a = 0
    if len(A) >= 2:
        b = A[1]
    else:
        b = 0

    dp[i] = dp[i] % (10**9 + 7)
    if not i+1 == a:
        dp[i+1] += dp[i]
    else:
        A.popleft()
    if not i+2 == b and not i+2 == a:
        dp[i+2] += dp[i]
print(dp[N])

Buggy python submission (verdict: Runtime Error):
from collections import deque
N, M = map(int, input().split())
A = deque()
[A.append(int(input())) for _ in range(M)]

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

for i in range(N+1):
    if A:
        a = A[0]
    if len(A) >= 2:
        b = A[1]

    dp[i] = dp[i] % (10**9 + 7)
    if not i+1 == a:
        dp[i+1] += dp[i]
    else:
        A.popleft()
    if not i+2 == b and not i+2 == a:
        dp[i+2] += dp[i]
print(dp[N])


Fixed submission:
from collections import deque
N, M = map(int, input().split())
A = deque()
[A.append(int(input())) for _ in range(M)]

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

for i in range(N+1):
    if A:
        a = A[0]
    else:
        a = 0
    if len(A) >= 2:
        b = A[1]
    else:
        b = 0

    dp[i] = dp[i] % (10**9 + 7)
    if not i+1 == a:
        dp[i+1] += dp[i]
    else:
        A.popleft()
    if not i+2 == b and not i+2 == a:
        dp[i+2] += dp[i]
print(dp[N])

Buggy python submission (verdict: Runtime Error):
from collections import deque
N, M = map(int, input().split())
A = deque()
[A.append(int(input())) for _ in range(M)]

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

for i in range(N+1):
    if A:
        a = A[0]
    if len(A) >= 2:
        b = A[1]

    dp[i] = dp[i] % (10**9 + 7)
    if not i+1 == a:
        dp[i+1] += dp[i]
    else:
        A.popleft()
    if not i+2 == b and not i+2 == a:
        dp[i+2] += dp[i]
print(dp[N])


Fixed submission:
from collections import deque
N, M = map(int, input().split())
A = deque()
[A.append(int(input())) for _ in range(M)]

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

for i in range(N+1):
    if A:
        a = A[0]
    else:
        a = 0
    if len(A) >= 2:
        b = A[1]
    else:
        b = 0

    dp[i] = dp[i] % (10**9 + 7)
    if not i+1 == a:
        dp[i+1] += dp[i]
    else:
        A.popleft()
    if not i+2 == b and not i+2 == a:
        dp[i+2] += dp[i]
print(dp[N])

Buggy python submission (verdict: Runtime Error):
from collections import deque
N, M = map(int, input().split())
A = deque()
[A.append(int(input())) for _ in range(M)]

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

for i in range(N+1):
    if A:
        a = A[0]
    if len(A) >= 2:
        b = A[1]

    dp[i] = dp[i] % (10**9 + 7)
    if not i+1 == a:
        dp[i+1] += dp[i]
    else:
        A.popleft()
    if not i+2 == b and not i+2 == a:
        dp[i+2] += dp[i]
print(dp[N])


Fixed submission:
from collections import deque
N, M = map(int, input().split())
A = deque()
[A.append(int(input())) for _ in range(M)]

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

for i in range(N+1):
    if A:
        a = A[0]
    else:
        a = 0
    if len(A) >= 2:
        b = A[1]
    else:
        b = 0

    dp[i] = dp[i] % (10**9 + 7)
    if not i+1 == a:
        dp[i+1] += dp[i]
    else:
        A.popleft()
    if not i+2 == b and not i+2 == a:
        dp[i+2] += dp[i]
print(dp[N])

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]

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

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


Fixed submission:
from collections import deque
N, M = map(int, input().split())
A = deque()
[A.append(int(input())) for _ in range(M)]

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

for i in range(N+1):
    if A:
        a = A[0]
    else:
        a = 0
    if len(A) >= 2:
        b = A[1]
    else:
        b = 0

    dp[i] = dp[i] % (10**9 + 7)
    if not i+1 == a:
        dp[i+1] += dp[i]
    else:
        A.popleft()
    if not i+2 == b and not i+2 == a:
        dp[i+2] += dp[i]
print(dp[N])

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]

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

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


Fixed submission:
from collections import deque
N, M = map(int, input().split())
A = deque()
[A.append(int(input())) for _ in range(M)]

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

for i in range(N+1):
    if A:
        a = A[0]
    else:
        a = 0
    if len(A) >= 2:
        b = A[1]
    else:
        b = 0

    dp[i] = dp[i] % (10**9 + 7)
    if not i+1 == a:
        dp[i+1] += dp[i]
    else:
        A.popleft()
    if not i+2 == b and not i+2 == a:
        dp[i+2] += dp[i]
print(dp[N])