def noboru(m):
    if (m == 1):
        return 1
    elif (m == 2):
        return 2
    else:
        return noboru(m-1)+noboru(m-2)

def func(N, M, a):
    ans = 1
    if (a[0] == 1):
        ans *=1
    else:
        ans *= noboru(a[0]-1)
    for i in range(1, M):
        if (a[i] == a[i-1]+1):
            return 0
        else:
            ans *= noboru(a[i] - 2 - a[i-1])
    ans *= noboru(a[M] - 1 - a[i])
    return ans % 1000000007

N, M = map(int, input().split(" "))
a = [int(input()) for _ in range(M)]
a.append(N)
print(func(N, M, a))