cnt = 0
aInt = []
bInt = []
xInt = int(input())
for i in range(xInt):    
    a, b = list(map(int, input().split()))
    aInt.append(a)
    bInt.append(b)

for i in range(xInt):
    for j in range(xInt):
        if(i==j):
            cnt = cnt +1
        elif (i>=j):
            if(((aInt[i]*aInt[j] + bInt[i]*bInt[j]) == 0) == False):
                cnt = cnt +1
       
print(str(cnt%1000000007))