#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int64_t modpow(int64_t x, int64_t n) {
  x = x % MOD;
  if (n == 0)
    return 1;
  else if (n % 2 == 1) {
    return (x * modpow(x, n - 1)) % MOD;
  } else
    return modpow((x * x) % MOD, n / 2) % MOD;
}
int main() {
  int64_t n;
  cin >> n;
  const int len = (int)(M_PI / 2 * 10000000) + 1;
  int *plus = (int *)malloc(sizeof(int) * len);
  int *minus = (int *)malloc(sizeof(int) * len);
  for (int i = 0; i < len; i++) {
    plus[i] = 0;
    minus[i] = 0;
  }
  int64_t n2 = n;
  for (int i = 0; i < n; i++) {
    int64_t a, b;
    cin >> a >> b;
    if (a == 0 && b == 0)
      n2--;
    else if (a == 0 && b != 0)
      plus[len - 1]++;
    else {
      int place = (int)(atan((long double)(b) / a));
      if (place > 0)
        plus[place]++;
      else
        minus[place]++;
    }
  }
  int64_t ans = 1;
  for (int i = 0; i < len; i++) {
    if (plus[i] == 0 && minus[len - 1 - i] == 0)
      continue;
    else if (plus[i] != 0 && minus[len - 1 - i] == 0) {
      ans += modpow(2, plus[i]);
      ans = ans % MOD;
    } else if (plus[i] == 0 && minus[len - 1 - i] != 0) {
      ans += modpow(2, minus[len - 1 - i]);
      ans = ans % MOD;
    } else {
      ans += (modpow(2, plus[i]) + modpow(2, minus[len - 1 - i]) - 1);
      ans = ans % MOD;
    }
  }
  cout << (ans - 1) % MOD << endl;
  return 0;
}
