#include <bits/stdc++.h>
using namespace std;
struct point {
  int x, y;
};
int n;
int p[8] = {1, 0, -1, 0, 1, 1, -1, -1};
int q[8] = {0, 1, 0, -1, 1, -1, 1, -1};
bool is_check(point K, point Q) {
  return Q.x == K.x || Q.y == K.y || abs(Q.x - K.x) == abs(Q.y - K.y);
}
bool vis[1005][1005];
point Q;
bool bfs(point K, point C) {
  queue<point> qx;
  vis[K.x][K.y] = 1;
  qx.push(K);
  while (!qx.empty()) {
    point now = qx.front();
    qx.pop();
    for (int i = 0; i < 8; i++) {
      point tmp = now;
      tmp.x += p[i];
      tmp.y += q[i];
      if (tmp.x > n || tmp.x < 1 || tmp.y > n || tmp.y < 1 || vis[tmp.x][tmp.y])
        continue;
      if (is_check(tmp, Q)) continue;
      vis[tmp.x][tmp.y] = 1;
      if (C.x == tmp.x && C.y == tmp.y) return 1;
      qx.push(tmp);
    }
  }
  return 0;
}
point K, C;
int main() {
  scanf("%d", &n);
  scanf("%d%d", &Q.x, &Q.y);
  scanf("%d%d", &K.x, &K.y);
  scanf("%d%d", &C.x, &C.y);
  if (bfs(K, C)) {
    printf("YES\n");
  } else
    printf("NO\n");
  return 0;
}
