#include <bits/stdc++.h>
using namespace std;
long long int n, x[100005], y[100005], a[100005];
vector<pair<long long int, long long int> > b;
vector<long long int> C;
bool isOnline(long long int i, long long int j, long long int k) {
  return ((y[i] - y[j]) * (x[j] - x[k]) == (y[j] - y[k]) * (x[i] - x[j]));
}
const long long int EPS = 0;
struct PT {
  long long int x, y;
  PT() {}
  PT(long long int x, long long int y) : x(x), y(y) {}
  bool operator<(const PT &rhs) const {
    return make_pair(y, x) < make_pair(rhs.y, rhs.x);
  }
  bool operator==(const PT &rhs) const {
    return make_pair(y, x) == make_pair(rhs.y, rhs.x);
  }
};
long long int cross(PT p, PT q) { return p.x * q.y - p.y * q.x; }
long long int area2(PT a, PT b, PT c) {
  return cross(a, b) + cross(b, c) + cross(c, a);
}
bool between(const PT &a, const PT &b, const PT &c) {
  return (abs(area2(a, b, c)) == 0 && (a.x - b.x) * (c.x - b.x) <= 0 &&
          (a.y - b.y) * (c.y - b.y) <= 0);
}
void ConvexHull(vector<PT> &pts) {
  sort(pts.begin(), pts.end());
  pts.erase(unique(pts.begin(), pts.end()), pts.end());
  vector<PT> up, dn;
  for (int i = 0; i < pts.size(); i++) {
    while (up.size() > 1 && area2(up[up.size() - 2], up.back(), pts[i]) >= 0)
      up.pop_back();
    while (dn.size() > 1 && area2(dn[dn.size() - 2], dn.back(), pts[i]) <= 0)
      dn.pop_back();
    up.push_back(pts[i]);
    dn.push_back(pts[i]);
  }
  pts = dn;
  for (int i = (int)up.size() - 2; i >= 1; i--) pts.push_back(up[i]);
  if (pts.size() <= 2) return;
  dn.clear();
  dn.push_back(pts[0]);
  dn.push_back(pts[1]);
  for (int i = 2; i < pts.size(); i++) {
    if (between(dn[dn.size() - 2], dn[dn.size() - 1], pts[i])) dn.pop_back();
    dn.push_back(pts[i]);
  }
  if (dn.size() >= 3 && between(dn.back(), dn[0], dn[1])) {
    dn[0] = dn.back();
    dn.pop_back();
  }
  pts = dn;
}
vector<PT> pts;
bool check1(pair<long long int, long long int> a,
            pair<long long int, long long int> b,
            pair<long long int, long long int> c,
            pair<long long int, long long int> d) {
  long long int a1, b1, c1, d1;
  for (int i = 1; i <= n; i++)
    if (x[i] == a.first && y[i] == a.second) a1 = i;
  for (int i = 1; i <= n; i++)
    if (x[i] == b.first && y[i] == b.second) b1 = i;
  for (int i = 1; i <= n; i++)
    if (x[i] == c.first && y[i] == c.second) c1 = i;
  if (d.first == -1e18) {
    C.clear();
    for (int i = 1; i <= n; i++)
      if (i != c1 && !isOnline(i, a1, b1)) C.push_back(i);
    if (C.size() <= 1) return 1;
    for (int j = 1; j < C.size(); j++)
      if (!isOnline(C[j], c1, C[0])) return 0;
    return 1;
  }
  for (int i = 1; i <= n; i++)
    if (x[i] == d.first && y[i] == d.second) d1 = i;
  long long int cnt = 0;
  for (int i = 1; i <= n; i++)
    if (isOnline(i, a1, b1) || isOnline(i, c1, d1)) cnt++;
  return (cnt == n);
}
bool check() {
  bool an = 0;
  b.clear();
  for (auto j : pts) b.push_back({j.x, j.y});
  if (b.size() == 2) return check1(b[0], b[1], b[0], b[1]);
  if (b.size() == 3) {
    for (int i = 1; i <= 7; i++) {
      an |= check1(b[0], b[1], b[2], {-1e18, -1e18});
      next_permutation(b.begin(), b.end());
    }
  }
  if (b.size() == 4) {
    for (int i = 1; i <= 25; i++) {
      an |= check1(b[0], b[1], b[2], b[3]);
      next_permutation(b.begin(), b.end());
    }
  }
  return an;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> x[i] >> y[i], a[i] = i;
  for (int i = 1; i <= n; i++) pts.push_back({x[i], y[i]});
  if (n < 4) return cout << "YES" << '\n', 0;
  ConvexHull(pts);
  if (check1({x[1], y[1]}, {x[2], y[2]}, {x[1], y[1]}, {x[2], y[2]}))
    return cout << "YES" << '\n', 0;
  if (pts.size() > 4) return cout << "NO" << '\n', 0;
  if (check()) return cout << "YES" << '\n', 0;
  cout << "NO" << '\n';
  return 0;
}

### Prompt

Create a solution in cpp for the following problem:

You are given n points on Cartesian plane. Every point is a lattice point (i. e. both of its coordinates are integers), and all points are distinct.

You may draw two straight lines (not necessarily distinct). Is it possible to do this in such a way that every point lies on at least one of these lines?

Input

The first line contains one integer n (1 ≤ n ≤ 105) — the number of points you are given.

Then n lines follow, each line containing two integers xi and yi (|xi|, |yi| ≤ 109)— coordinates of i-th point. All n points are distinct.

Output

If it is possible to draw two straight lines in such a way that each of given points belongs to at least one of these lines, print YES. Otherwise, print NO.

Examples

Input

5
0 0
0 1
1 1
1 -1
2 2


Output

YES


Input

5
0 0
1 0
2 1
1 1
2 3


Output

NO

Note

In the first example it is possible to draw two lines, the one containing the points 1, 3 and 5, and another one containing two remaining points.

<image>

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
long long int n, x[100005], y[100005], a[100005];
vector<pair<long long int, long long int> > b;
vector<long long int> C;
bool isOnline(long long int i, long long int j, long long int k) {
  return ((y[i] - y[j]) * (x[j] - x[k]) == (y[j] - y[k]) * (x[i] - x[j]));
}
const long long int EPS = 0;
struct PT {
  long long int x, y;
  PT() {}
  PT(long long int x, long long int y) : x(x), y(y) {}
  bool operator<(const PT &rhs) const {
    return make_pair(y, x) < make_pair(rhs.y, rhs.x);
  }
  bool operator==(const PT &rhs) const {
    return make_pair(y, x) == make_pair(rhs.y, rhs.x);
  }
};
long long int cross(PT p, PT q) { return p.x * q.y - p.y * q.x; }
long long int area2(PT a, PT b, PT c) {
  return cross(a, b) + cross(b, c) + cross(c, a);
}
bool between(const PT &a, const PT &b, const PT &c) {
  return (abs(area2(a, b, c)) == 0 && (a.x - b.x) * (c.x - b.x) <= 0 &&
          (a.y - b.y) * (c.y - b.y) <= 0);
}
void ConvexHull(vector<PT> &pts) {
  sort(pts.begin(), pts.end());
  pts.erase(unique(pts.begin(), pts.end()), pts.end());
  vector<PT> up, dn;
  for (int i = 0; i < pts.size(); i++) {
    while (up.size() > 1 && area2(up[up.size() - 2], up.back(), pts[i]) >= 0)
      up.pop_back();
    while (dn.size() > 1 && area2(dn[dn.size() - 2], dn.back(), pts[i]) <= 0)
      dn.pop_back();
    up.push_back(pts[i]);
    dn.push_back(pts[i]);
  }
  pts = dn;
  for (int i = (int)up.size() - 2; i >= 1; i--) pts.push_back(up[i]);
  if (pts.size() <= 2) return;
  dn.clear();
  dn.push_back(pts[0]);
  dn.push_back(pts[1]);
  for (int i = 2; i < pts.size(); i++) {
    if (between(dn[dn.size() - 2], dn[dn.size() - 1], pts[i])) dn.pop_back();
    dn.push_back(pts[i]);
  }
  if (dn.size() >= 3 && between(dn.back(), dn[0], dn[1])) {
    dn[0] = dn.back();
    dn.pop_back();
  }
  pts = dn;
}
vector<PT> pts;
bool check1(pair<long long int, long long int> a,
            pair<long long int, long long int> b,
            pair<long long int, long long int> c,
            pair<long long int, long long int> d) {
  long long int a1, b1, c1, d1;
  for (int i = 1; i <= n; i++)
    if (x[i] == a.first && y[i] == a.second) a1 = i;
  for (int i = 1; i <= n; i++)
    if (x[i] == b.first && y[i] == b.second) b1 = i;
  for (int i = 1; i <= n; i++)
    if (x[i] == c.first && y[i] == c.second) c1 = i;
  if (d.first == -1e18) {
    C.clear();
    for (int i = 1; i <= n; i++)
      if (i != c1 && !isOnline(i, a1, b1)) C.push_back(i);
    if (C.size() <= 1) return 1;
    for (int j = 1; j < C.size(); j++)
      if (!isOnline(C[j], c1, C[0])) return 0;
    return 1;
  }
  for (int i = 1; i <= n; i++)
    if (x[i] == d.first && y[i] == d.second) d1 = i;
  long long int cnt = 0;
  for (int i = 1; i <= n; i++)
    if (isOnline(i, a1, b1) || isOnline(i, c1, d1)) cnt++;
  return (cnt == n);
}
bool check() {
  bool an = 0;
  b.clear();
  for (auto j : pts) b.push_back({j.x, j.y});
  if (b.size() == 2) return check1(b[0], b[1], b[0], b[1]);
  if (b.size() == 3) {
    for (int i = 1; i <= 7; i++) {
      an |= check1(b[0], b[1], b[2], {-1e18, -1e18});
      next_permutation(b.begin(), b.end());
    }
  }
  if (b.size() == 4) {
    for (int i = 1; i <= 25; i++) {
      an |= check1(b[0], b[1], b[2], b[3]);
      next_permutation(b.begin(), b.end());
    }
  }
  return an;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> x[i] >> y[i], a[i] = i;
  for (int i = 1; i <= n; i++) pts.push_back({x[i], y[i]});
  if (n < 4) return cout << "YES" << '\n', 0;
  ConvexHull(pts);
  if (check1({x[1], y[1]}, {x[2], y[2]}, {x[1], y[1]}, {x[2], y[2]}))
    return cout << "YES" << '\n', 0;
  if (pts.size() > 4) return cout << "NO" << '\n', 0;
  if (check()) return cout << "YES" << '\n', 0;
  cout << "NO" << '\n';
  return 0;
}

```