Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
A=[int(input()) for __ in range(M)]
ans=[0]*(N+1)
ans[0] = 1

if 1 in A:
    ans[1]=0
else:
    ans[1]=1

for n in range(N+1):
    if n>1:
        if n-1 in A and n in A:
            print(0)
            break
        elif n in A:
            ans[n]=0
        else:
            ans[n]=(ans[n-1]+ans[n-2]) % 1000000007
else:
    print(ans[N])


Fixed submission:
N,M=map(int,input().split())
A=set([int(input()) for __ in range(M)])
ans=[0]*(N+1)
ans[0] = 1

if 1 in A:
    ans[1]=0
else:
    ans[1]=1

for n in range(N+1):
    if n>1:
        if n-1 in A and n in A:
            print(0)
            break
        elif n in A:
            ans[n]=0
        else:
            ans[n]=(ans[n-1]+ans[n-2]) % 1000000007
else:
    print(ans[N])

Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
A=[int(input()) for __ in range(M)]
ans=[0]*N

if 0 in A:
    ans[1]=1
elif 1 in A:
    ans[0]=1
else:
    ans[0]=1
    ans[1]=2

for n in range(N):
    if n>1:
        if n+1 in A and n in A:
            print(0)
            break
        elif n+1 in A:
            ans[n]=0
        else:
            ans[n]=ans[n-1]+ans[n-2]
            ans[n] %= 1000000007
else:
    print(ans[N-1])


Fixed submission:
N,M=map(int,input().split())
A=set([int(input()) for __ in range(M)])
ans=[0]*(N+1)
ans[0] = 1

if 1 in A:
    ans[1]=0
else:
    ans[1]=1

for n in range(N+1):
    if n>1:
        if n-1 in A and n in A:
            print(0)
            break
        elif n in A:
            ans[n]=0
        else:
            ans[n]=(ans[n-1]+ans[n-2]) % 1000000007
else:
    print(ans[N])

Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
A=[int(input()) for __ in range(M)]
ans=[0]*N

if 1 in A:
    ans[0]=0
    ans[1]=1
else:
    ans[0]=1
    ans[1]=2

for n in range(N):
    if n>1:
        if n+1 in A and n in A:
            print(0)
            break
        elif n+1 in A:
            ans[n]=0
        else:
            ans[n]=ans[n-1]+ans[n-2]
            ans[n] %= 1000000007
else:
    print(ans[N-1])


Fixed submission:
N,M=map(int,input().split())
A=set([int(input()) for __ in range(M)])
ans=[0]*(N+1)
ans[0] = 1

if 1 in A:
    ans[1]=0
else:
    ans[1]=1

for n in range(N+1):
    if n>1:
        if n-1 in A and n in A:
            print(0)
            break
        elif n in A:
            ans[n]=0
        else:
            ans[n]=(ans[n-1]+ans[n-2]) % 1000000007
else:
    print(ans[N])

Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
A=[int(input()) for __ in range(M)]
ans=[0]*N

if 1 in A:
    ans[0]=0
    ans[1]=1
else:
    ans[0]=1
    ans[1]=2

for n in range(N):
    if n>1:
        if n+1 in A and n in A:
            print(0)
            break
        elif n+1 in A:
            ans[n]=0
        else:
            ans[n]=ans[n-1]+ans[n-2]
            ans[n] %= 10**9+7
else:
    print(ans[N-1])


Fixed submission:
N,M=map(int,input().split())
A=set([int(input()) for __ in range(M)])
ans=[0]*(N+1)
ans[0] = 1

if 1 in A:
    ans[1]=0
else:
    ans[1]=1

for n in range(N+1):
    if n>1:
        if n-1 in A and n in A:
            print(0)
            break
        elif n in A:
            ans[n]=0
        else:
            ans[n]=(ans[n-1]+ans[n-2]) % 1000000007
else:
    print(ans[N])