<?php
$N = (int)fgets(STDIN);
$angles = [];
$botti = 0;

for ($i = 0; $i < $N; $i++) {
    list($A, $B) = array_map(function ($n) {
        return (int)$n;
    }, explode(' ', fgets(STDIN)));
    if ($A === 0 && $B === 0) {
        $botti += 1;
        continue;
    } elseif ($A === 0) {
        if (!isset($angles['0'])) {
            $angles['0'] = [0, 0];
        }
        $angles['0'][1] += 1;
    } elseif ($B === 0) {
        if (!isset($angles['0'])) {
            $angles['0'] = [0, 0];
        }
        $angles['0'][0] += 1;
    } else {
        $iwashi = round($B/$A, 36);
        if ($iwashi < 0) {
            $angle = (string)round(-1.0 * $A/$B, 36);
            if (!isset($angles[$angle])) {
                $angles[$angle] = [0, 0];
            }
            $angles[$angle][1] += 1;
        } else {
            $iwashi = (string)$iwashi;
            if (!isset($angles[$iwashi])) {
                $angles[$iwashi] = [0, 0];
            }
            $angles[$iwashi][0] += 1;
        }
    }
}

$ans = 1;

foreach ($angles as $num_angle_pare) {
    $ans *= (pow(2, $num_angle_pare[0]) % 1000000007 + pow(2, $num_angle_pare[1]) % 1000000007 - 1) % 1000000007;
    $ans %= 1000000007;
}

echo ($ans + $botti - 1) % 1000000007;