def calc_step_combination(num):
    if num == 0:
        return 0
    if num == 1:
        return 1
    if num == 2:
        return 2
    return calc_step_combination(num - 1) + calc_step_combination(num - 2)


def sol(n, a_list):
    step_batch = []
    batch_start = 0
    for a in a_list:
        step_batch.append(a - batch_start - 1)
        batch_start = a + 1
    step_batch.append(n - batch_start)

    result = 1
    for i, steps in enumerate(step_batch):
        if i == 0 and steps == 0:
            continue
        result *= calc_step_combination(steps)

    print(result % 1_000_000_007)


def main():
    n, m = map(int, input().split())
    a_list = []
    for i in range(0, m):
        a_list = int(input())
    sol(n, a_list)


main()