def main():
    n,m =map(int, input().split())
    #idxへの行き方の通りをリスト化
    num_list = [0]*(n+2)
    num_list[0] = 1
    a_list =[int(input()) for _ in range(m)]
    a_list.append(0)
    count = 0
    div =1000000007
    for i in range(n):
        
        if num_list[i] ==0:
            continue
        if i+1 is not a_list[count]:
            num_list[i+1] += num_list[i]
        else:
            count +=1
            if i+2 is not a_list[count]:
                num_list[i+2] += num_list[i]
                continue
            else:
                return 0
        if i+2 is not a_list[count]:
            num_list[i+2] += num_list[i]
    #print(num_list)
    return num_list[-2]%div

if __name__=='__main__':
    print(main())