def fib(n, broken):
    a = 1
    b = 1
    for i in range(n-2):
        # if i in broken:

        a, b = b, a + b
    print(b)


n, m = [int(x) for x in input().split()]
broken = set()
for _ in range(m):
    broken.add(int(input()))

x = 0
y = 1
i = 1
impossible = False
while i <= n:
    # print(f'degrau: {i}')
    c = 0
    if i in broken:
        if i + 1 in broken:
            impossible = True
        # print('broken')
        x = y
        # y = x
        # print(f'x: {x}, y: {y}')
        previous_broken = False
        while c < 2:
            i += 1
            if i in broken:
                if previous_broken:
                    impossible = True
                previous_broken = True
                continue
            else:
                previous_broken = False
                c += 1
        # i += 2
    else:
        y, x = x + y % 1000000007, y % 1000000007
        # print(f'x: {x}, y: {y}')
    i += 1
print(0) if impossible else print(y % 1000000007)
