#include <bits/stdc++.h>
using namespace std;
int main() {
  int ax, ay, bx, by, cx, cy, i, j, t, n, s;
  cin >> n >> ax >> ay >> bx >> by >> cx >> cy;
  if ((ax < bx && ax > cx) || (ax > bx && ax < cx) || (ay < by && ay > cy) ||
      (ay > by && ay < cy)) {
    cout << "NO" << endl;
  } else
    cout << "YES" << endl;
}
