import sys
n, m = map(int, input().split())
a = [int(input()) for _ in range(m)]
d = [0] * (n + 1)
if n == 1:
    print(1)
    sys.exit()
d[0] = 1
d[1] = 1
for i in range(2, n + 1):
    if i  in a:
        d[i] = 0
    elif i - 1 in a:
        if i - 2 in a:
            print(0)
            sys.exit()
        else:
            d[i] = d[i - 2]
    elif i - 2 in a:
        d[i] = d[i - 1]
    else:
        d[i] = d[i - 1] + d[i - 2]
d[-1] %= 1000000007
print(d[-1])