import unittest


class TestC(unittest.TestCase):
    def test_1(self):
        self.assertEqual(think(6, [3]), 4)

    def test_2(self):
        self.assertEqual(think(10, [4, 5]), 0)

    def test_3(self):
        self.assertEqual(think(100, [1, 23, 45, 67, 89]), 608200469)


def solve():
    n, a = read()
    result = think(n, a)
    write(result)


def read():
    n, m = read_int(2)
    a = [0 for x in range(m)]
    for i in range(m):
        a[i] = read_int(1)[0]
    return n, a


def read_int(n):
    return read_type(int, n)


def read_float(n):
    return read_type(float, n)


def read_type(t, n):
    return list(map(lambda x: t(x), read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(n, a):
    mode = 1000000007
    INVALID = -1

    ways = [0 for x in range(n + 1)]
    ways[0] = 1
    for e in a:
        ways[e] = INVALID

    for i in range(1, len(ways)):
        if i in a:
            continue
        if i >= 2:
            ways[i] += 0 if ways[i - 1] == INVALID else ways[i - 1]
            ways[i] += 0 if ways[i - 2] == INVALID else ways[i - 2]
            ways[i] %= mode
        else:
            ways[i] = 0 if ways[i - 1] == INVALID else ways[i - 1]
    return ways[-1]


def write(result):
    print(result)


if __name__ == '__main__':
    # unittest.main()
    solve()