def next_step_patterns(i, n_patterns1, n_patterns2):
    """
    i段目に登る場合の数を計算する
    n_patterns1 (int):
        i-1段目に登る場合の数
    n_patterns2 (int):
        i-2段目に登る場合の数
    """
    
    if i in A:
        return 0
    
    if i == 1:
        return 1
    elif i == 2:
        return 1 + n_patterns1
    else:
        return n_patterns1 + n_patterns2
      
      
N, M = list(map(int, input().split()))
A = [int(input()) for _ in range(M)]

n_patterns1, n_patterns2 = 0, 0
for i in range(1, N+1):
    now = next_step_patterns(i, n_patterns1, n_patterns2)
    n_patterns2 = n_patterns1
    n_patterns1 = now
print(now%1000000007)