// #include <bits/stdc++.h>
// string s;
// getline(cin, s);
// g++ -std=c++11 -O2 -Wall test.cpp -o test
// printf("%.9f\n", x); PRECISION

#include <algorithm>
#include <cmath>
#include <iostream>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;
using ll = long long;

#define F first
#define S second

const long long MOD = 1e9 + 7;
const double EPS = 1e-9;

const int MAX_LENGTH = (2 * 1e5 + 1);
int n, c;
long long x;
long long dp[MAX_LENGTH][2];

void solve() {
    set<int> set_ids;
    unordered_map<int, long long> max_pos;
    unordered_map<int, long long> min_pos;
    int MMIN = 0, MMAX = 1;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> x >> c;
        set_ids.insert(c);
        if (max_pos.find(c) == max_pos.end()) {
            max_pos[c] = x;
            min_pos[c] = x;
        } else {
            max_pos[c] = max(max_pos[c], x);
            min_pos[c] = min(min_pos[c], x);
        }
    }
    vector<int> ids(set_ids.begin(), set_ids.end());
    n = ids.size();
    dp[n - 1][MMIN] = abs(min_pos[ids[n - 1]] - max_pos[ids[n - 1]]) +
                      abs(max_pos[ids[n - 1]]);
    dp[n - 1][MMAX] = abs(min_pos[ids[n - 1]] - max_pos[ids[n - 1]]) +
                      abs(min_pos[ids[n - 1]]);

    for (int i = n - 2; i >= 0; i--) {
        int cur = ids[i];
        int next = ids[i + 1];
        long long d = abs(min_pos[cur] - max_pos[cur]);
        dp[i][MMIN] =
            d + min(dp[i + 1][MMAX] + abs(max_pos[next] - max_pos[cur]),
                    dp[i + 1][MMIN] + abs(min_pos[next] - max_pos[cur]));
        dp[i][MMAX] =
            d + min(dp[i + 1][MMAX] + abs(max_pos[next] - min_pos[cur]),
                    dp[i + 1][MMIN] + abs(min_pos[next] - min_pos[cur]));
    }
    cout << min(abs(min_pos[ids[0]]) + dp[0][MMIN],
                abs(max_pos[ids[0]]) + dp[0][MMAX]);
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int t = 1;
    // cin >> t;
    for (int i = 1; i <= t; i++) {
        // cout <<"Case #" << i << ": ";
        solve();
    }
}
#include<bits/stdc++.h>
using namespace std;

int main(){
  int n; cin >> n;
  vector<int> x(n);
  vector<int> y(n);
  for(int i=0; i<n; i++){
    cin >> x.at(i);
    cin >> y.at(i);
  }
  
  for(int i=0; i<n-2; i++){
    for(int j=i+1; j<n-1; j++){
      for(int k=j+1; k<n; k++){
        if((x.at(j)-x.at(i))*(y.at(k)-y.at(j)) == (x.at(k)-x.at(j))*(y.at(j)-y.at(i))){
          cout << "Yes" << endl;
          return (0);
        }
      }
    }
  }
  cout << "No" << endl;
  
}