#include <bits/stdc++.h>
using namespace std;
int path[][2] = {{-1, 0}, {-1, 1}, {0, 1},  {1, 1},
                 {1, 0},  {1, -1}, {0, -1}, {-1, -1}};
int n, desx, desy, ans = 0;
int chess[1005][1005];
void dfs(int x, int y) {
  int dx, dy;
  for (int i = 0; i < 8; i++) {
    dx = x;
    dy = y;
    dx = dx + path[i][0];
    dy = dy + path[i][1];
    while (dx >= 1 && dx <= n && dy >= 1 && dy <= n) {
      chess[dx][dy] = 1;
      dx = dx + path[i][0];
      dy = dy + path[i][1];
    }
  }
}
void slove(int x, int y) {
  int dx, dy;
  if (x == desx && y == desy) {
    ans = 1;
    return;
  }
  if (chess[x][y] == 1) return;
  chess[x][y] = 2;
  for (int i = 0; i < 8; i++) {
    dx = x + path[i][0];
    dy = y + path[i][1];
    if (dx >= 1 && dx <= n && dy >= 1 && dy <= n && chess[dx][dy] == 0) {
      slove(dx, dy);
      if (ans) return;
    }
  }
}
int main() {
  int ax, ay;
  scanf("%d%d%d", &n, &ax, &ay);
  chess[ax][ay] = 1;
  dfs(ax, ay);
  scanf("%d%d%d%d", &ax, &ay, &desx, &desy);
  if (chess[desx][desy] == 1 || chess[ax][ay] == 1)
    ans = 0;
  else
    slove(ax, ay);
  if (ans == 0)
    printf("NO");
  else if (ans == 1)
    printf("YES");
  return 0;
}
