def solve(N, M, A):
    answer = [0] * (N+1)
    answer[0] = 1
    if 1 in A:
        answer[1] = 0
    else:
        answer[1] = 1

    for s in range(2, N+1):
        if s in A:
            answer[s] = 0
        else:
            answer[s] = (answer[s-2] + answer[s-1])
    print(answer[N] % 1000000007)

N, M = [int(x) for x in input().split()]
A = set()
for i in range(M):
    A.add(int(input().split()))
solve(N, M, A)

