#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define P pair<ll, ll>
#define Graph vector<vector<ll>>
#define fi first
#define se second
#define vvvll vector<vector<vector<ll>>>
#define vvll vector<vector<ll>>
#define vll vector<ll>
#define pqll priority_queue<ll>

constexpr ll INF = (1ll << 60);
constexpr ll mod = 1000000007;  // 998244353;
constexpr double pi = 3.14159265358979323846;
template <typename T>
inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T>
inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return 1;
    }
    return 0;
}

void pt_vvll(vvll v) {
    rep(i, v.size()) {
        rep(j, v[0].size()) {
            cout << v[i][j];
            if (j != v[0].size() - 1)
                cout << " ";
            else
                cout << "\n";
        }
    }
}
void pt_vll(vll v) {
    rep(i, v.size()) {
        cout << v[i];
        if (i == v.size() - 1)
            cout << "\n";
        else
            cout << " ";
    }
}

vector<ll> sum, ans;
void pre_process(vector<ll> &a, vector<ll> &s) {  //累積和のvector
    ll n = (ll)a.size();
    s.assign(n + 1, 0);
    for (ll i = 0; i < n; i++) {
        s[i + 1] = s[i] + a[i];
    }
}
ll query(ll i, ll j, vector<ll> &s) {  //区間[i,j]の和
    return (s[j] - s[i]);
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    ll N;
    cin >> N;
    vll A(N);
    rep(i, N) cin >> A[i];

    pre_process(A, sum);
    reverse(sum.begin(), sum.end());
    sum.pop_back();
    reverse(sum.begin(), sum.end());

    pre_process(sum, ans);

    // pt_vll(ans);

    vll MAX_A(N + 1);
    ll ma = 0;
    rep(i, N + 1) {
        chmax(ma, sum[i]);
        MAX_A[i] = ma;
    }

    ll pt = 0;
    rep(i, ans.size()) {
        ll plus = (i < N ? MAX_A[i + 1] : 0ll);
        chmax(pt, ans[i] + max(0ll, plus));
        // cout << pt << "\n";
    }

    // pt_vll(ans);

    cout << pt << "\n";
    return 0;
}
#include <bits/stdc++.h>
using namespace std;
//↓AC-library使うなら

//型関係
using Graph = vector<vector<int>>;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> pll;
typedef priority_queue<int, vector<int>, greater<int>> PQ;//昇順priority_queue
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<P > vpii;
typedef vector<pll > vpll;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;
//repマクロ
#define rep(i, n) for (int i = 0; i < (ll)(n); i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (int i = a; i < (ll)(b); i++)
#define FORD(i, a, b) for (int i = a; i >= (ll)(b); i--)
//範囲関係
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
#define all(x) (x).begin(), (x).end()
#define len(x) ((int)(x).size())
#define ZERO(a) memset(a,0,sizeof(a))
//定数
#define inf 1000000000000
#define mod 1000000007
#define MAXR 100000
#define MATHPI acos(-1)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int INF = INT_MAX;
const ll LLINF = 1LL<<60;
//操作
#define pb push_back
#define pf push_front
#define mp make_pair
#define F first
#define S second
//数学関係, a<=x<=b
bool updown(ll x, ll a, ll b) { return x >= a && x <= b; }
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
#define SUM(x) accumulate(all(x), 0)
#define bit(n) (1LL<<(n))
//chmin, chmax
template <class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;} return 0;}
template <class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;} return 0;}
//小数出力(f...出力したい小数, n...小数点以下の桁数)
void printd(double f, int n) { cout << fixed << setprecision(n) << f << endl; } //指定した桁で小数を出力
//YES/NO, Yes/No, yes/no出力
void YES(bool c = true) { cout << (c ? "YES" : "NO") << endl; } //YES(条件式)で記述
void Yes(bool c = true) { cout << (c ? "Yes" : "No") << endl; } //Yes(条件式)で記述
void yes(bool c = true) { cout << (c ? "yes" : "no") << endl; } //yes(条件式)で記述
//除外用
#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev
//if use atcoder library:g++ main.cpp -std=c++17 -I /home/k0gane/kyopro/ac-library
//累積和
//https://qiita.com/drken/items/56a6b68edef8fc605821
//point...n+1の容量のリストを作る
//
//深さ優先...push_front
//幅優先...push_backP

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;cin >> n;
  vpii p(n); rep(i, n) cin >> p[i].F >> p[i].S;
  
  rep(i, n-2){
    FOR(j, i+1, n-1){
      FOR(k, j+1, n){
         if((p[j].F - p[k].F) * (p[i].S - p[j].S)  == (p[i].F - p[j].F) * (p[j].S - p[k].S)){cout << "Yes" << endl; exit(0);}
      }
    }
  }
  cout << "No" << endl;
  return 0;
}
