#include "bits/stdc++.h"
using namespace std;
using ll=int64_t;
using ld=long double;
using ull=unsigned long long;
template <class T>
using grid=vector<vector<T>>;
#define ALL(x) x.begin(),x.end()
#define rep(iter,from,to) for(ll iter=from;iter<to;++iter)

const ll MOD=1e9+7;
const ll INF=1e17;
//#######################################################################
vector<vector<ll>> input(ll N, ll width){
    string str;
    vector<vector<ll>> vec(N,vector<ll>(width));
    for(ll i=0;i<N;++i){
        cin>>str;
        reverse(ALL(str));
        for(ll j=0;j<width;++j){
            vec[i][j]=str.back();
            str.pop_back();
        }
    }
    return vec;
}
void op(vector<ll> vec){
    ll size=(ll)vec.size();
    for(ll i=0;i<size-1;++i) cout<<vec[i]<<" ";
    cout<<vec.back()<<endl;
}

void op(vector<vector<ll>> vec){
    ll height=(ll)vec.size();
    ll width=(ll)vec[0].size();
    for(ll i=0;i<height;++i) {
        for(ll j=0;j<width-1;++j) cout<<vec[i][j]<<" ";
        cout<<vec[i].back()<<endl;
    }
}
//########################################################################

struct position{
    ll x;
    ll y;
};

void solve(){
    ll N;
    cin>>N;
    vector<position> cd(N);
    vector<ld> slope(N);
    rep(i,0,N) {
        cin>>cd[i].x>>cd[i].y;
    }
    rep(i,0,N-2) rep(j,i+1,N-1) rep(k,j+1,N){
        position a,b,c;
        a=cd[i]; b=cd[j]; c=cd[k];
        ll s1=(c.y-a.y)*(b.x-a.x);
        ll s2=(b.y-a.y)*(c.x-a.x);
        if(s1==s2) {
            cout<<"Yes"<<endl;
            return;
        }
    }
    cout<<"No"<<endl;
}


int main(void){
    std::cin.tie(nullptr);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	solve();
}

// 2020-10-17 20:19:18
// clang-format off
#include <bits/stdc++.h>
#ifdef LOCAL
#include "lib/debug.hpp"
#else
#define debug(...) 1
#endif
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define rep(i, n) REP(i, 0, (n))
#define repc(i, n) REPC(i, 0, (n))
#define REP(i, n, m) for (int i = (int)(n); i < (int)(m); i++)
#define REPC(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define REPCM(i, n, m) for (int i = (int)(n); i >= (int)(m); i--)
using namespace std;
using ll = long long;
using ld = long double;
using pr = pair<ll, ll>;
using vll = vector<ll>;
using vpr = vector<pr>;
using P = pair<int, int>;
template<class T> inline bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; } else return false; }
template<class T> inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } else return false; }
// #include <atcoder/convolution>
// #include <atcoder/dsu>
// #include <atcoder/fenwicktree>
// #include <atcoder/lazysegtree>
// #include <atcoder/math>
// #include <atcoder/maxflow>
// #include <atcoder/mincostflow>
// #include <atcoder/modint>
// #include <atcoder/scc>
// #include <atcoder/segtree>
// #include <atcoder/string>
// #include <atcoder/twosat>
// #include <atcoder/all>
// using namespace atcoder;

// clang-format on
const ll inf = 1e18;
int n;
vector<ll> x, y, z;
vector<vector<ll> > dp;
ll dist(int i, int j) {
  return abs(x[i] - x[j]) + abs(y[i] - y[j]) + max(0ll, z[j] - z[i]);
}
ll rec(int i, int S) {
  if (dp[i][S] >= 0) return dp[i][S];
  if (__builtin_popcount(S) == 1) {
    return dp[i][S] = dist(0, i);
  }
  ll cur = inf;
  int T = S & (~(1 << i));
  rep(j, n) if (i != j && (S >> j) & 1) chmin(cur, rec(j, T) + dist(j, i));
  return dp[i][S] = cur;
}
void answer() {
  cin >> n;
  x.resize(n);
  y.resize(n);
  z.resize(n);
  rep(i, n) cin >> x[i] >> y[i] >> z[i];
  dp.resize(n, vector<ll>(1 << n, -1));
  rec(0, (1 << n) - 1);
  cout << dp[0][(1 << n) - 1] << '\n';
}

int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  answer();
  return 0;
}