#include <bits/stdc++.h>
using namespace std;
vector<long long> graph[1005];
int visited[1005][1005];
void dfs(int i, int j, int n) {
  if (i > 0 && i <= n && j > 0 && j <= n && visited[i][j] == 0) {
    visited[i][j] = 1;
    dfs(i + 1, j + 1, n);
    dfs(i - 1, j - 1, n);
    dfs(i + 1, j, n);
    dfs(i, j + 1, n);
    dfs(i - 1, j, n);
    dfs(i - 1, j + 1, n);
    dfs(i + 1, j - 1, n);
    dfs(i, j - 1, n);
  }
}
void show(int n) {
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) cout << visited[i][j] << " ";
    cout << endl;
  }
}
void coverQueen(int i, int j, int n) {
  for (int k = 1; k <= n; k++) {
    visited[i][k] = 2;
    visited[k][j] = 2;
  }
  int x = i, y = j;
  while (x != n + 1 && y != n + 1) {
    visited[x][y] = 2;
    x++;
    y++;
  }
  x = i, y = j;
  while (x != 0 && y != 0) {
    visited[x][y] = 2;
    x--;
    y--;
  }
  x = i, y = j;
  while (x > 0 && y < n + 1) {
    visited[x][y] = 2;
    x--;
    y++;
  }
  x = i, y = j;
  while (x != n + 1 && y != 0) {
    visited[x][y] = 2;
    x++;
    y--;
  }
}
int main() {
  memset(visited, 0, sizeof(visited));
  long long n;
  cin >> n;
  int ki, kj, ei, ej, qi, qj;
  cin >> qi >> qj;
  cin >> ki >> kj;
  cin >> ei >> ej;
  coverQueen(qi, qj, n);
  dfs(ki, kj, n);
  if (visited[ei][ej])
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
