#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, ax, ay, bx, by, cx, cy;
  cin >> n >> ax >> ay >> bx >> by >> cx >> cy;
  if ((ax > bx && ax > cx) || (ax < bx && ax < cx)) {
    if ((ay > by && ay > cy) || (ay < by && ay < cy)) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
