#include <cstdio>
#include <algorithm>
#include <map>
#include <utility>

using i8 = std::int8_t;
using u8 = std::uint8_t;
using i16 = std::int16_t;
using u16 = std::uint16_t;
using i32 = std::int32_t;
using u32 = std::uint32_t;
using i64 = std::int64_t;
using u64 = std::uint64_t;
using i128 = __int128_t;
using u128 = __uint128_t;
using usize = std::size_t;

using pair = std::pair<i64, i64>;

constexpr i64 MOD = 1000000007;

template<typename T, typename U>
constexpr auto pow_mod(T a, U b, const T m) -> T {
	T r = 1;
	while (b > 0) {
		if (b % 2 != 0) r = r * a % m;
		a = a * a % m;
		b >>= 1;
	}
	return r;
}

auto main() -> i32 {
	i32 n;
	scanf("%d", &n);

	auto polar_cmp = [](const auto& a, const auto& b) {
		i128 ax = a.first;
		i128 ay = a.second;
		i128 bx = b.first;
		i128 by = b.second;
		return 0 < ax * by - ay * bx;
	};

	std::map<pair, i32, decltype(polar_cmp)> mp(polar_cmp);
	i64 zeros = 0;
	for (i32 i = 0; i < n; ++i) {
		i64 a, b;
		scanf("%ld%ld", &a, &b);
		if (b < 0) {
			a = -a;
			b = -b;
		}
		if (b == 0 && a < 0) {
			a = -a;
		}
		if (a != 0 || b != 0) {
			mp[pair(a, b)] += 1;
		} else {
			zeros += 1;
		}
	}

	i64 ans = 1;
	for (auto& [k, v] : mp) {
		auto tx = -k.second;
		auto ty = k.first;
		if (ty < 0) {
			tx = -tx;
			ty = -ty;
		}
		if (ty == 0 && tx > 0) {
			tx = -tx;
		}

		if (auto it = mp.find(pair(tx, ty)); it == mp.end()) {
			ans = ans * pow_mod((i64)2, v, MOD) % MOD;
		} else if (k.first > 0) {
			ans = ans * (pow_mod((i64)2, v, MOD) + pow_mod((i64)2, it->second, MOD) - 1) % MOD;
		}
	}
	ans = (ans + zeros + MOD - 1) % MOD;

	printf("%ld\n", ans);

	return 0;
}
