Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = []
for i in range(M):
    a = int(input())
    A.append(a)
def step(n):
    steps = [0 for i in range(n + 1)]
    ind = 0
    steps[0] = 1
    steps[1] = 1
    if 1 == A[ind]:
        steps[1] = 0
        if ind < M-1:
            ind += 1
    for i in range(2, n + 1):
        steps[i] = steps[i - 1] + steps[i - 2]
        if i == A[ind]:
            steps[i] = 0
            if ind < M-1:
                ind += 1
    return steps[n] % 1000000007
print(step(N))

Fixed submission:
N, M = map(int, input().split())
A = []
for i in range(M):
    a = int(input())
    A.append(a)
def step(n):
    steps = [0 for i in range(n + 1)]
    ind = 0
    steps[0] = 1
    steps[1] = 1
    if M != 0:
        if 1 == A[ind]:
            steps[1] = 0
            if ind < M-1:
                ind += 1
    for i in range(2, n + 1):
        steps[i] = steps[i - 1] + steps[i - 2]
        if M != 0:
            if i == A[ind]:
                steps[i] = 0
                if ind < M-1:
                    ind += 1
    return steps[n] % 1000000007
print(step(N))

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = []
for i in range(M):
    a = int(input())
    A.append(a)
def step(n):
    steps = [0 for i in range(n + 1)]
    ind = 0
    steps[0] = 1
    steps[1] = 1
    if 1 == A[ind]:
        steps[1] = 0
        ind += 1
    for i in range(2, n + 1):
        steps[i] = steps[i - 1] + steps[i - 2]
        if i == A[ind]:
            steps[i] = 0
            if ind < M-1:
                ind += 1
    return steps[n] % 1000000007
print(step(N))

Fixed submission:
N, M = map(int, input().split())
A = []
for i in range(M):
    a = int(input())
    A.append(a)
def step(n):
    steps = [0 for i in range(n + 1)]
    ind = 0
    steps[0] = 1
    steps[1] = 1
    if M != 0:
        if 1 == A[ind]:
            steps[1] = 0
            if ind < M-1:
                ind += 1
    for i in range(2, n + 1):
        steps[i] = steps[i - 1] + steps[i - 2]
        if M != 0:
            if i == A[ind]:
                steps[i] = 0
                if ind < M-1:
                    ind += 1
    return steps[n] % 1000000007
print(step(N))

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = []
import sys
flg = 0
for i in range(M):
    a = int(input())
    if a == 1 or a == 2:
        flg = a
    if i != 0:
        if a == A[-1] + 1:
            flg = 3
    A.append(a)
if flg == 3:
    print(0)
    sys.exit()
ary = list(range(3, N + 1))
for a in A:
    try:
        ary.remove(a)
    except:
        pass
def step(n):
    steps = [0 for i in range(n + 1)]
    if flg == 0:
        steps[1] = 1
        steps[2] = 2
    elif flg == 1:
        steps[2] = 1
    else:
        steps[1] = 1
    for i in ary:
        steps[i] = steps[i - 1] + steps[i - 2]
    return steps[n] % 1000000007
print(step(N))

Fixed submission:
N, M = map(int, input().split())
A = []
for i in range(M):
    a = int(input())
    A.append(a)
def step(n):
    steps = [0 for i in range(n + 1)]
    ind = 0
    steps[0] = 1
    steps[1] = 1
    if M != 0:
        if 1 == A[ind]:
            steps[1] = 0
            if ind < M-1:
                ind += 1
    for i in range(2, n + 1):
        steps[i] = steps[i - 1] + steps[i - 2]
        if M != 0:
            if i == A[ind]:
                steps[i] = 0
                if ind < M-1:
                    ind += 1
    return steps[n] % 1000000007
print(step(N))

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = []
import sys
flg = 0
for i in range(M):
    a = int(input())
    if a == 1 or a == 2:
        flg = a
    if i != 0:
        if a == A[-1] + 1:
            print(0)
            sys.exit()
    A.append(a)
def step(n):
    steps = [0 for i in range(n + 1)]
    if flg == 0:
        steps[1] = 1
        steps[2] = 2
    elif flg == 1:
        steps[2] = 1
    else:
        steps[1] = 1
    for i in range(3, n + 1):
        steps[i] = steps[i - 1] + steps[i - 2]
        if i in A:
            steps[i] = 0
    return steps[n] % 1000000007
print(step(N))

Fixed submission:
N, M = map(int, input().split())
A = []
for i in range(M):
    a = int(input())
    A.append(a)
def step(n):
    steps = [0 for i in range(n + 1)]
    ind = 0
    steps[0] = 1
    steps[1] = 1
    if M != 0:
        if 1 == A[ind]:
            steps[1] = 0
            if ind < M-1:
                ind += 1
    for i in range(2, n + 1):
        steps[i] = steps[i - 1] + steps[i - 2]
        if M != 0:
            if i == A[ind]:
                steps[i] = 0
                if ind < M-1:
                    ind += 1
    return steps[n] % 1000000007
print(step(N))