def resolve():


    from collections import deque

    n, m = map(int, input().split())
    ddp = deque(maxlen=2)

    li_broken = [0] * m
    for i in range(m):
        li_broken[i] = int(input())

    ddp.appendleft(0)
    ddp.appendleft(1)

    li_i = list(reversed(range(n)))

    for i in li_i:

        if i in li_broken:
            ddp.appendleft(0)

        else:
            ddp.appendleft(sum(ddp) % 1000000007)

    print(ddp[0])
    
resolve()
