import sys
n, m = map(int, input().split())
holes = []
pos = [1] * (n+1)
ans = 1

def calc(n):
    if n == 0:
        return 1
    if n == 1:
        pos[1]  = 1
        return 1
    elif n == 2:
        pos[2] = 2
        return 2
    else:
        pos[n] = pos[n-1] + pos[n-2]
        return pos[n]

for i in range(n):
    calc(i)

for i in range(m):
    holes.append(int(input()))

for i in range(m):
    if i > 0 and holes[i] == holes[i - 1] + 1:
        print(0)
        sys.exit()

for i in range(len(holes)):
    # print("\n # i: " + str(i))
    # print("# holes[i]: " + str(holes[i]))
    if i == 0:
        if holes[i] == 1:
            ans = 1
        else:
            ans = calc(holes[i] - 1)
#        print("# ans: " + str(ans))
    else:
        ans = ans * (calc(holes[i] - holes[i - 1] - 2))
#        print("# ans: " + str(ans))

    if i == len(holes) - 1:
        # print("\nlast!")
        # print("holes[i]: " + str(holes[i]))
        # print("dif: " + str(n - holes[i]))

        if holes[i] == n:
            break

        ans = ans * (calc(n - holes[i] - 1))
#        print("# ans: " + str(ans))


print(ans % 1000000007)
#print(calc(0))
