def dp(p, a, memo):
    if p in memo.keys():
        return memo[p]
    else:
        ans = 0
        if p == 0:
            return 1
        else:
            if p in a:
                ans = 0
            else:
                ans = dp(p-1, a, memo) + dp(p-2, a, memo)
            memo[p] = ans
            return ans

# input
n, m = map(int, input().split())
a = [map(int, input().split()) for i in range(m)]
memo = {}

print(dp(n, a, memo) % (10**9+7))