import math
import sys
input = sys.stdin.readline
n = int(input())
x = [[0,0] for _ in range(n)]
h = 36000
c = 0
y = [[] for _ in range(h)]
mod = 10**9+7
c1 = 0
c2 = 0
for i in range(n):
  ai,bi = map(int,input().split())
  if ai == 0 and bi == 0:
    c += 1
  elif ai == 0:
    c1 += 1
  elif bi == 0:
    c2 += 1
  else:
    j = int((math.degrees(math.atan2(ai, bi))+180)*100)%36000
    flag = True
    for ca in y[j]:
      if ai*ca[0][1] == bi*ca[0][0]:
        x[ca[1]][0] += 1
        flag = False
        break
    for ca in y[(j+18000)%h]:
      if ai*ca[0][1] == bi*ca[0][0]:
        x[ca[1]][0] += 1
        flag = False
        break
    for ca in y[(j+9000)%h]:
      if ai*ca[0][0]+bi*ca[0][1] == 0:
        x[ca[1]][1] += 1
        flag = False
        break
    for ca in y[(j-9000)%h]:
      if ai*ca[0][0]+bi*ca[0][1] == 0:
        x[ca[1]][1] += 1
        flag = False
        break
    if flag:
      y[j].append([(ai,bi),i])
      x[i][0] = 1
ans = 1
ans =(2**c1 + 2**c2 -1)%mod
for xi in x:
  if xi[0] == 0:
    if xi[1] != 0:
      ans = (ans*2**(xi[1]))%mod
  else:
    if xi[1] == 0:
      ans = (ans*2**(xi[0]))%mod
    else:
      ans = (ans*(2**(xi[0])+2**(xi[1])-1))%mod
ans = (ans+c-1)%mod
print(ans)