def C_TypicalStairs():
    N, M = map(int, input().split())
    am = [int(input()) for i in range(M)]
    n_list = [i for i in range(N+1)]
    can_move = True
    num_move = 0
    # 到達不可を除く
    for i in range(M-1):
        if ((am[i] + 1) == am[i+1]):
            can_move = False
    if (can_move):
        num_move = fib(len(n_list[:am[0]]))
        if (M <= 1):
            pass
        else:
            for i in range(M-1):
                num_move *= fib(len(n_list[am[i]+1:am[i+1]]))
        num_move *= fib(len(n_list[am[M-1]+1:]))
    print(num_move % 1000000007)

def fib(n):
    if (n <= 1):
        a0 = n
    else:
        a0, a1 = 0, 1
        for _ in range(n):
            a0, a1 = a1, a0 + a1
    return a0
if __name__ == "__main__":
    C_TypicalStairs()