#include <bits/stdc++.h>
#define ll long long
#define ls id << 1
#define rs id << 1 | 1
#define mem(array, value, size, type) memset(array, value, ((size) + 5) * sizeof(type))
#define memarray(array, value) memset(array, value, sizeof(array))
#define fillarray(array, value, begin, end) fill((array) + (begin), (array) + (end) + 1, value)
#define fillvector(v, value) fill((v).begin(), (v).end(), value)
#define pb(x) push_back(x)
#define st(x) (1LL << (x))
#define pii pair<int, int>
#define mp(a, b) make_pair((a), (b))
#define Flush fflush(stdout)
#define vecfirst (*vec.begin())
#define veclast (*vec.rbegin())
#define vecall(v) (v).begin(), (v).end()
#define vecupsort(v) (sort((v).begin(), (v).end()))
#define vecdownsort(v, type) (sort(vecall(v), greater<type>()))
#define veccmpsort(v, cmp) (sort(vecall(v), cmp))
using namespace std;
const int N = 500050;
const int inf = 0x3f3f3f3f;
const ll llinf = 0x3f3f3f3f3f3f3f3f;
const int mod = 998244353;
const int MOD = 1e9 + 7;
const double PI = acos(-1.0);
clock_t TIME__START, TIME__END;
void program_end()
{
#ifdef ONLINE
    printf("\n\nTime used: %.6lf(s)\n", ((double)TIME__END - TIME__START) / 1000);
    system("pause");
#endif
}
int n;
pair<ll, ll> p[N];
bool check(int i, int j, int k)
{
    pair<ll, ll> v1 = mp(p[i].first - p[j].first, p[i].second - p[j].second);
    pair<ll, ll> v2 = mp(p[j].first - p[k].first, p[j].second - p[k].second);
    if(v1.first * v2.second - v1.second * v2.first == 0)
        return 1;
    return 0;
}

inline void solve()
{
    cin >> n;
    for (int i = 1; i <= n; ++i)
        cin >> p[i].first >> p[i].second;
    for (int i = 1; i <= n; ++i)
        for (int j = i + 1; j <= n; ++j)
            for (int k = j + 1; k <= n; ++k)
            {
                if(check(i,j,k))
                    return puts("Yes"), void();
            }
    puts("No");
}

int main()
{
    TIME__START = clock();
    int Test = 1;
    // scanf("%d", &Test);
    while (Test--)
    {
        solve();
        // if (Test)
        //     putchar('\n');
    }
    TIME__END = clock();
    program_end();
    return 0;
}
#include <bits/stdc++.h>
using namespace std;
#define int long long

set<int> returnSet(vector<vector<int>> &v, int x) {
  set<int> st;
  for (int i = 0; i < v.size(); i++) {
    int val = 0;
    int pow = 1;
    for (int j = 0; j < 5; j++) {
      if (v[i][j] >= x) val += pow;
      pow *= 2;
    }
    st.insert(val);
  }
  return st;
}

signed main() {
  int n;
  cin >> n;

  vector<vector<int>> v(n, vector<int>(5));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 5; j++) {
      cin >> v[i][j];
    }
  }

  int l = 0, r = INT_MAX;
  int res = 0;
  while(r - l > 1) {
    int mid = (l + r) / 2;
    set<int> st = returnSet(v, mid);

//    for (auto it : st) cout << it << " ";
//    cout << '\n';

    bool ok = false;
    for (auto v1 : st) {
      for (auto v2: st) {
        for (auto v3: st) {
          if ((v1 | v2 | v3) == (1 << 5) - 1) ok = true;
        }
      }
    }

    if (ok) l = mid;
    else r = mid;
  }
  cout << l << '\n';
}
