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