M=1000000007

def normalize(v)
  return [0,0] if v[0].zero? && v[1].zero?
  d=v[0].abs.gcd(v[1].abs)
  x=v[0]/d
  y=v[1]/d
  x,y=-x,-y if y<0
  x=-x if y.zero? && x<0
  [x,y]
end

def orthogonal(v)
  normalize([-v[1],v[0]])
end

def pow(n,m)
  return 1 if m.zero?
  m.odd? ? (n*pow(n,m-1)%M) : pow(n*n%M,m/2)
end

zer=0
h=Hash.new{|h,k|h[k]=0}
gets.to_i.times.map{gets.split.map(&:to_i)}.each do |v|
  if v.all?{|i|i.zero?}
    zer+=1
  else
    h[normalize(v)]+=1
  end
end

ans=1
used={}
h.each do |v,_|
  n=orthogonal(v)
  next if used[n]
  used[n]=true
  ans*=(h.key?(n) ? pow(2,h[v])+pow(2,h[n])-1 : pow(2,h[v]))
  ans%=M
end
p (zer+ans-1+M)%M