N = int(input())
A = list()
for i in range(N):
  a,b  =map(int,input().split())
  A.append([a,b])
n = 0

for i in range(n - 1):
  for j in range(i + 1,j):
    if A[i][0] * A[j][0] + A[i][1] + A[j][1] == 0:
      n += 1



fac = [1,1]
inv = [1,1]
finv = [1,1]

MOD = 100000007
for i in range(2,N + 1):
    tmp = fac[-1] * i % MOD
    fac.append(tmp)
    tmp = MOD - inv[MOD % i] * (MOD // i) % MOD
    inv.append(tmp)
    tmp = finv[-1] * inv[i] % MOD
    finv.append(tmp)
    
ret = N - n # k = 1

for i in range(2,N+1):
  tmp = ((fac[N] * finv[N-i]) % MOD * finv[i]) % MOD
  tmp2 = ((fac[n] * finv[n-i]) % MOD * finv[i]) % MOD
  ret += (tmp - tmp2) % MOD
ret = ret % MOD
return ret

