N=int(input())
ls=[list(map(int,input().split())) for _ in range(N)]
s=0
for i in range(0,N):
    x=ls[i][0]+ls[i][1]
    if x!=0:
        s=s+1
for j in range(0,N):
    for k in range(j+1,N):
        y=ls[j][0]*ls[k][0]+ls[j][1]*ls[k][1]
        if y!=0:
            s=s+1
print(s%1000000007)            