#include <bits/stdc++.h>
using namespace std;
int n, ax, ay, bx, by, cx, cy;
int main() {
  cin >> n >> bx >> by >> ax >> ay >> cx >> cy;
  bool ok = true;
  if (ax > cx) swap(ax, cx);
  for (int i = ax; i <= cx && ok; i++)
    if (i == bx) ok = false;
  if (ok) {
    if (ay > cy) swap(ay, cy);
    for (int i = ay; i <= cy && ok; i++)
      if (i == by) ok = 0;
  }
  if (ok)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
