program ABC168_E
  integer(16),allocatable::A(:),B(:),C(:)
  integer(16)::ans=0
  read(*,*)N
  allocate(A(N),B(N),C(N))
  C=0
  do i=1,N
     read(*,*)A(i),B(i)
  end do
  do i=1,N-1
     do j=i+1,N
        if(A(i)*A(j)+B(i)*B(j)==0) C(i)=C(i)+1
     end do
  end do
  do i=1,N-1
  ans=ans+mod(2**(N-i-C(i)),1000000007)
  ans=mod(ans,1000000007)
  end do
  write(*,*)ans+1
end program ABC168_E