#include <bits/stdc++.h>
using namespace std;
const int N = 1010;
int dis[N][N], vis[2][N][N], vis1[N][N];
int dx[] = {1, 1, 1, -1, -1, -1, 0, 0};
int dy[] = {0, 1, -1, 1, 0, -1, 1, -1};
int n;
void dfs(int x, int y, int ck) {
  queue<pair<int, int> > q;
  q.push({x, y});
  vis[ck][x][y] = 1;
  while (!q.empty()) {
    pair<int, int> u = q.front();
    q.pop();
    for (int i = 0; i < 8; i++) {
      int tx = dx[i] + u.first;
      int ty = dy[i] + u.second;
      if (tx >= 1 && tx <= n && ty >= 1 && ty <= n && !vis[ck][tx][ty] &&
          !vis[ck ^ 1][tx][ty]) {
        vis[ck][tx][ty] = 1;
        q.push({tx, ty});
      }
    }
  }
}
void bfs(int x, int y, int ck) {
  queue<pair<int, int> > q;
  q.push({x, y});
  vis[0][x][y] = 1;
  while (!q.empty()) {
    pair<int, int> u = q.front();
    q.pop();
    int tx = dx[ck] + u.first;
    int ty = dy[ck] + u.second;
    if (tx >= 1 && tx <= n && ty >= 1 && ty <= n && !vis[0][tx][ty]) {
      vis[0][tx][ty] = 1;
      q.push({tx, ty});
    }
  }
}
int main() {
  cin >> n;
  int a1, b1, a2, b2, x, y;
  cin >> a1 >> b1 >> a2 >> b2 >> x >> y;
  for (int i = 0; i < 8; i++) bfs(a1, b1, i);
  dfs(a2, b2, 1);
  if (vis[1][x][y])
    puts("YES");
  else
    puts("NO");
  return 0;
}
