n = int(input())

l = []

for i in range(n):
  ll = map(int, input().split())
  l.append(ll)
  
c = 0

for i in range(m):
  for j in range(m-i+1):
    if not i == j:
      if l[i][0] *l[j][0] + l[i][1] *l[j][1] == 0:
        c = 1 + c % 1000000007
        
mm = m % 1000000007

print(mm-c)