#include <bits/stdc++.h>
using namespace std;
int check(int a, int b, int x, int y, int n) {
  if (a >= 1 && a < x) {
    if (b >= 1 && b < y)
      return 1;
    else if (b > y && b <= n)
      return 4;
    else
      return 0;
  } else {
    if (b >= 1 && b < y)
      return 2;
    else if (b > y && b <= n)
      return 3;
    else
      return 0;
  }
}
int main() {
  int n;
  cin >> n;
  int ax, ay;
  cin >> ax >> ay;
  int bx, by;
  int cx, cy;
  cin >> bx >> by;
  cin >> cx >> cy;
  int a = check(bx, by, ax, ay, n);
  int b = check(cx, cy, ax, ay, n);
  if (a == 0 || b == 0) {
    cout << "NO" << endl;
  } else {
    if (a == b) {
      cout << "YES" << endl;
    } else
      cout << "NO" << endl;
  }
  return 0;
}
