#include <bits/stdc++.h>
using namespace std;
bool check(int n, int ax, int ay, int bx, int by) {
  if (ax == bx || ay == by || abs(ax - bx) == abs(ay - by)) return true;
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  int n, ax, ay, bx, by, cx, cy;
  cin >> n >> ax >> ay >> bx >> by >> cx >> cy;
  if (check(n, ax, ay, bx, by) || check(n, ax, ay, cx, cy)) {
    cout << "NO" << '\n';
    return 0;
  }
  if (bx <= ax && ax <= cx || by <= ay && ay <= cy || cx <= ax && ax <= bx ||
      cy <= ay && ay <= by) {
    cout << "NO" << '\n';
    return 0;
  }
  cout << "YES" << '\n';
  return 0;
}
