#include <bits/stdc++.h>
using namespace std;
long long int power(long long int x, long long int y,
                    long long int md = 1e9 + 7) {
  long long int res = 1;
  x %= md;
  while (y > 0) {
    if (y & 1) res = (res * x) % md;
    x *= x;
    if (x >= md) x %= md;
    y >>= 1;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  int arr[n][2];
  for (long long int i = 0; i < n; ++i) {
    for (long long int j = 0; j < 2; ++j) {
      cin >> arr[i][j];
    }
  }
  long long int ways = n;
  for (long long int i = 0; i < n; ++i) {
    for (long long int k = i + 1; k < n; ++k) {
      if (arr[i][0] * arr[k][0] + arr[i][1] * arr[k][1] != 0 and i < n - 1 and
          k < n) {
        ways++;
        ways %= (long long int)1e9 + 7;
      }
    }
  }
  cout << ways;
}
