N, M = map(int, input().split())
broken_stairs = list(int(input()) for _ in range(M))

MOD = 1000000007


def get_route_num(num):
    # print('step num', num)
    if num == 0:
        return 1
    if num < 4:
        return num
    prev_route = 3  # num = 3
    prev_prev_route = 2  # num = 2
    route = prev_route + prev_prev_route
    for _ in range(4, num + 1):
        route = prev_route + prev_prev_route
        prev_prev_route = prev_route
        prev_route = route
        # print('route', route)
    return route


if len(broken_stairs) == 0:
    print(get_route_num(N))
    exit()

cur = 0
possible_route = 1
for i in range(M):
    if not cur == 0 and broken_stairs[i] - cur == 0:
        print(0)
        exit()
    step = broken_stairs[i] - cur - 1
    possible_route *= (get_route_num(step) % MOD)
    # possible_route %= MOD
    cur = broken_stairs[i] + 1

possible_route *= get_route_num(N - cur)
print(possible_route % MOD)
