n, m = map(int, input().split())

hole_count = 0
pattern = [0,1]

a = int(input())
hole_count += 1

for i in range(n):
    index = i + 1
    if index == a:
        pattern.append(0)
        if hole_count < m:
            a = int(input())
            hole_count += 1
    else:
        pattern.append(pattern[-1] + pattern[-2])

print(pattern[-1] % 1000000007)