#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, T[3][2], a = 0, b = 0;
  cin >> n;
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 2; j++) {
      cin >> T[i][j];
    }
  }
  if (T[1][0] < T[0][0]) {
    if (T[2][0] < T[0][0]) a++;
  } else {
    if (T[2][0] > T[0][0]) a++;
  }
  if (T[1][1] < T[0][1]) {
    if (T[2][1] < T[0][1]) a++;
  } else {
    if (T[2][1] > T[0][1]) a++;
  }
  if (a == 2)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
