import numpy as np
# -*- coding: utf-8 -*-
N = int(input())
X = np.zeros((N, 2))
for i in range(N):
    X[i,:] = list(map(int, input().split()))
print("{0}".format((((X @ X.T)[np.triu_indices(N, 1)] > 0).sum() + N)% 1000000007) )