def fibonacci(N):
    a = 1
    b = 2
    c = 0

    if N <= 1:
        return 1
    elif N == 2:
        return 2
    else:
        for i in range(N-2):
            c = a+b
            a = b
            b = c
    return c


def main():
    N,M = map(int,input().split())
    A = [int(input()) for _ in range(M)]

    temp = 1
    for i in range(M+1):
        if i == 0:
            num = fibonacci(A[i]-1)
        else:
            if i <= M-1:
                if A[i-1] == A[i]-1:
                    print(0)
                    return
                num = fibonacci(A[i]-A[i-1]-2)
            else:
                num = fibonacci(N-A[i-1]-1)
        temp *= num
    print(temp%1000000007)


if __name__ == '__main__':
    main()
