#include <bits/stdc++.h>
using namespace std;
int x[] = {-1, -1, -1, 0, 0, 1, 1, 1};
int y[] = {-1, 0, 1, -1, 1, -1, 0, -1};
const int MOD = 1e9 + 7, N = 2e5 + 5;
const double pi = acos(-1);
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  cin >> n;
  int x1, y1;
  cin >> x1 >> y1;
  int x2, y2, x3, y3;
  cin >> x2 >> y2 >> x3 >> y3;
  if ((x2 <= x1 && x3 >= x1) || (x2 >= x1 && x3 <= x1) ||
      (y2 <= y1 && y3 >= y1) || (y2 >= y1 && y3 <= y1))
    cout << "NO";
  else
    cout << "YES";
  return 0;
}
