from collections import deque
import math
mod = 10**9 + 7
n = int(input())
a = [0] *n
b = [0] * n
que = deque()
for i in range(n):
  A,B = map(int, input().split())
  g = math.gcd(A,B)
  a[i] = A//g
  b[i] = B//g

t = set()
for i in range(n):
  x,y = a[i],b[i]
  for j in range(i,n):
    if x*a[j] + y*b[j] == 0:
      que.append([i,j])
      t.add(i)
      t.add(j)

ans = 1
for k in range(1,n):
  ans += (math.factorial(n) / (math.factorial(k) * math.factorial(n-k))) % mod

while que:
  na = que.pop()
  m = len(na)
  for k in range(m,n+1):
    ans -= (math.factorial(n-m) / (math.factorial(k-m) *  math.factorial(n-k))) % mod

for d in range(3,len(t)+1):
  for k in range(d,n+1):
    ans += (math.factorial(n-d) / (math.factorial(k-d) *  math.factorial(n-k))) % mod

print(int(ans))
