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

inf=float("inf")

fib_memo = [-inf for i in range(n+1)]
fib_memo[0] = 1
if 1 in a:
    fib_memo[1]=0
else:
    fib_memo[1]=1

if 1 in [a[i] - a[i-1] for i in range(1,m)]:
    print(0)
    import sys
    sys.exit()
else:
    cur_fib_i = 2
    while cur_fib_i <= n:
        if cur_fib_i in a:
            fib_memo[cur_fib_i]=0
        else:
            fib_memo[cur_fib_i] = fib_memo[cur_fib_i-1] + fib_memo[cur_fib_i-2]
        cur_fib_i += 1
print(fib_memo[n]%1000000007)
#print(fib_memo)


Fixed submission:
# -*- coding: utf-8 -*-
n,m = list(map(int,input().split()))
a = [int(input()) for i in range(m)]

inf=float("inf")

fib_memo = [-inf for i in range(n+1)]
fib_memo[0] = 1
if 1 in a:
    fib_memo[1]=0
else:
    fib_memo[1]=1
for i in a:
    fib_memo[i]=0

if 1 in [a[i] - a[i-1] for i in range(1,m)]:
    print(0)
    import sys
    sys.exit()
else:
    cur_fib_i = 2
    while cur_fib_i <= n:
        if fib_memo[cur_fib_i]==0:
            pass
        else:
            fib_memo[cur_fib_i] = fib_memo[cur_fib_i-1] + fib_memo[cur_fib_i-2]
        cur_fib_i += 1
print(fib_memo[n]%1000000007)
#print(fib_memo)

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

inf=float("inf")

fib_memo = [1]
if 1 in a:
    fib_memo.append(0)
else:
    fib_memo.append(1)

if 1 in [a[i] - a[i-1] for i in range(1,m)]:
    print(0)
    import sys
    sys.exit()
else:
    cur_fib_i = 2
    while cur_fib_i <= n:
        if cur_fib_i in a:
            fib_memo.append(0)
        else:
            fib_memo.append(fib_memo[cur_fib_i-1] + fib_memo[cur_fib_i-2])
        cur_fib_i += 1
print(fib_memo[n]%1000000007)
#print(fib_memo)


Fixed submission:
# -*- coding: utf-8 -*-
n,m = list(map(int,input().split()))
a = [int(input()) for i in range(m)]

inf=float("inf")

fib_memo = [-inf for i in range(n+1)]
fib_memo[0] = 1
if 1 in a:
    fib_memo[1]=0
else:
    fib_memo[1]=1
for i in a:
    fib_memo[i]=0

if 1 in [a[i] - a[i-1] for i in range(1,m)]:
    print(0)
    import sys
    sys.exit()
else:
    cur_fib_i = 2
    while cur_fib_i <= n:
        if fib_memo[cur_fib_i]==0:
            pass
        else:
            fib_memo[cur_fib_i] = fib_memo[cur_fib_i-1] + fib_memo[cur_fib_i-2]
        cur_fib_i += 1
print(fib_memo[n]%1000000007)
#print(fib_memo)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n,m = list(map(int,input().split()))
a = [int(input()) for i in range(m)]

inf=float("inf")
i_pattern = [-inf for i in range(n+1)]

#i段目までの行き方を数える
def solve(i):
    if i == 1:
        if 1 in a:
            i_pattern[1] = 0
            return 0
        else:
            i_pattern[1] = 1
            return 1
    if i == 0:
        i_pattern[0]=1
        return 1
    if i_pattern[i] >= 0:
        ret = i_pattern[i]
    else :
        if i in a:
            i_pattern[i]=0
            return 0
        ret = solve(i-1)+solve(i-2)
        i_pattern[i]=ret
    return ret

print(solve(n)%1000000007)


Fixed submission:
# -*- coding: utf-8 -*-
n,m = list(map(int,input().split()))
a = [int(input()) for i in range(m)]

inf=float("inf")

fib_memo = [-inf for i in range(n+1)]
fib_memo[0] = 1
if 1 in a:
    fib_memo[1]=0
else:
    fib_memo[1]=1
for i in a:
    fib_memo[i]=0

if 1 in [a[i] - a[i-1] for i in range(1,m)]:
    print(0)
    import sys
    sys.exit()
else:
    cur_fib_i = 2
    while cur_fib_i <= n:
        if fib_memo[cur_fib_i]==0:
            pass
        else:
            fib_memo[cur_fib_i] = fib_memo[cur_fib_i-1] + fib_memo[cur_fib_i-2]
        cur_fib_i += 1
print(fib_memo[n]%1000000007)
#print(fib_memo)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n,m = list(map(int,input().split()))
a = [int(input()) for i in range(m)]

inf=float("inf")
i_pattern = [-inf for i in range(n+1)]

#i段目までの行き方を数える
def solve(i):
    if i == 1:
        if 1 in a:
            i_pattern[1] = 0
            return 0
        else:
            i_pattern[1] = 1
            return 1
    if i == 0:
        i_pattern[0]=1
        return 1
    if i_pattern[i] >= 0:
        ret = i_pattern[i]
    else :
        if i in a:
            i_pattern[i]=0
            return 0
        ret = solve(i-1)+solve(i-2)
        i_pattern[i]=ret
    return ret

print(solve(n)%1000000007)


Fixed submission:
# -*- coding: utf-8 -*-
n,m = list(map(int,input().split()))
a = [int(input()) for i in range(m)]

inf=float("inf")

fib_memo = [-inf for i in range(n+1)]
fib_memo[0] = 1
if 1 in a:
    fib_memo[1]=0
else:
    fib_memo[1]=1
for i in a:
    fib_memo[i]=0

if 1 in [a[i] - a[i-1] for i in range(1,m)]:
    print(0)
    import sys
    sys.exit()
else:
    cur_fib_i = 2
    while cur_fib_i <= n:
        if fib_memo[cur_fib_i]==0:
            pass
        else:
            fib_memo[cur_fib_i] = fib_memo[cur_fib_i-1] + fib_memo[cur_fib_i-2]
        cur_fib_i += 1
print(fib_memo[n]%1000000007)
#print(fib_memo)