#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using vi = vector<int>;
using tii = tuple<int, int, int>;
const int INF = 1e9;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  pii a, b, c;
  cin >> a.first >> a.second >> b.first >> b.second >> c.first >> c.second;
  if ((b.first < a.first && c.first > a.first) ||
      (b.first > a.first && c.first < a.first)) {
    cout << "NO\n";
  } else if ((b.second < a.second && c.second > a.second) ||
             (b.second > a.second && c.second < a.second)) {
    cout << "NO\n";
  } else if (a.first == b.first || c.first == a.first || a.second == b.second ||
             a.second == c.second) {
    cout << "NO\n";
  } else {
    cout << "YES" << endl;
  }
}
