def C_TypicalStairs():

    N, M = list(map(int, input().split()))

    am = [int(eval(input())) for i in range(M)]

    n_list = [i for i in range(N+1)]

    can_move = True

    num_move = 0

    if(M == 0):

        num_move = fib(len(n_list))

    else:

        # 到達不可を除く

        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()
def C_TypicalStairs():

    N, M = list(map(int, input().split()))

    am = [int(eval(input())) for i in range(M)]

    can_move = True

    num_move = 0

    if(M == 0):

        num_move = fib(N+1)

    else:

        # 到達不可を除く

        for i in range(M-1):

            if ((am[i] + 1) == am[i+1]):

                can_move = False

        if (can_move):

            num_move = fib(am[0])

            if (M <= 1):

                pass

            else:

                for i in range(M-1):

                    num_move *= fib(am[i+1] - am[i] - 1)

            num_move *= fib(N - am[M-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()
def C_TypicalStairs():
    N, M = list(map(int, input().split()))
    am = [int(eval(input())) for i in range(M)]
    n_list = [i for i in range(N + 1)]
    can_move = True
    num_move = 0
    if M == 0:
        num_move = fib(len(n_list))
    else:
        # 到達不可を除く
        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()

def C_TypicalStairs():
    N, M = list(map(int, input().split()))
    am = [int(eval(input())) for i in range(M)]
    can_move = True
    num_move = 0
    if M == 0:
        num_move = fib(N + 1)
    else:
        # 到達不可を除く
        for i in range(M - 1):
            if (am[i] + 1) == am[i + 1]:
                can_move = False
        if can_move:
            num_move = fib(am[0])
            if M <= 1:
                pass
            else:
                for i in range(M - 1):
                    num_move *= fib(am[i + 1] - am[i] - 1)
            num_move *= fib(N - am[M - 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()

-    n_list = [i for i in range(N + 1)] -        num_move = fib(len(n_list)) +        num_move = fib(N + 1) -            num_move = fib(len(n_list[: am[0]])) +            num_move = fib(am[0]) -                    num_move *= fib(len(n_list[am[i] + 1 : am[i + 1]])) -            num_move *= fib(len(n_list[am[M - 1] + 1 :])) +                    num_move *= fib(am[i + 1] - am[i] - 1) +            num_move *= fib(N - am[M - 1])