import sys
INF = 1 << 60
MOD = 10**9 + 7 # 998244353
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
from cmath import phase
from math import gcd
from collections import Counter
def resolve():
    n = int(input())
    zero = 0
    counter = Counter()
    for _ in range(n):
        x, y = map(int, input().split())
        # eliminate 0 vector
        if x == 0 and y == 0:
            zero += 1
            continue
        # standardize (0 <= arg(z) < pi)
        g = gcd(x, y)
        x //= g
        y //= g
        if y < 0:
            x *= -1
            y *= -1
        elif y == 0:
            x, y = 1, 0
        counter[complex(x, y)] += 1

    if zero == n:
        print(n)
        return

    k = len(counter)
    C = list(counter.items())
    C.sort(key = lambda tup:phase(tup[0]))
    vector = [tup[0] for tup in C]
    count = [tup[1] for tup in C]

    res = 0
    dp = [0] * (k + 1)
    dp[0] = 1
    for i in range(k):
        z = vector[i]
        vert = z.imag - z.real * 1j
        dp[i + 1] += dp[i]
        dp[i + 1] += (pow(2, count[i], MOD) - 1) * dp[i] * pow(2, -counter[vert] % (MOD - 1), MOD)
        dp[i + 1] %= MOD

    res = dp[k]
    res -= 1
    res += zero
    print(res % MOD)
resolve()