#include <bits/stdc++.h>
using namespace std;
int n, queen;
vector<bool> visited;
int label(int x, int y) { return x + y * n; }
bool check(int v) {
  int x = v % n, y = v / n, qx = queen % n, qy = queen / n;
  if (x == qx || y == qy || x + y == qx + qy || x - y == qx - qy) return true;
  return false;
}
vector<int> neighbor(int v) {
  vector<int> res;
  int x = v % n, y = v / n;
  vector<pair<int, int>> dir = {{1, 0}, {-1, 0}, {0, 1},  {0, -1},
                                {1, 1}, {1, -1}, {-1, 1}, {-1, 1}};
  for (auto d : dir) {
    int nx = x + d.first, ny = y + d.second;
    if (nx >= 0 && nx < n && ny >= 0 && ny < n && !check(label(nx, ny)))
      res.push_back(label(nx, ny));
  }
  return res;
}
void dfs(int root) {
  visited[root] = true;
  for (auto nxt : neighbor(root))
    if (!visited[nxt]) dfs(nxt);
}
int main() {
  int ax, ay, bx, by, cx, cy;
  cin >> n >> ax >> ay >> bx >> by >> cx >> cy;
  ax -= 1;
  ay -= 1;
  bx -= 1;
  by -= 1;
  cx -= 1;
  cy -= 1;
  queen = label(ax, ay);
  visited.assign(n * n, false);
  int king = label(bx, by);
  dfs(king);
  cout << (visited[label(cx, cy)] ? "YES" : "NO") << endl;
}
