#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int ax, ay;
  scanf("%d %d", &ax, &ay);
  int bx, by;
  scanf("%d %d", &bx, &by);
  int cx, cy;
  scanf("%d %d", &cx, &cy);
  if (bx > cx) {
    swap(bx, cx);
  }
  if (by > cy) {
    swap(by, cy);
  }
  if ((bx < ax && cx > ax) || (by < ay && cy > ay)) {
    printf("NO\n");
  } else {
    printf("YES\n");
  }
}
