#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, ax, ay, bx, by, cx, cy, k = 0;
  cin >> n >> ax >> ay >> bx >> by >> cx >> cy;
  if ((cx < ax && bx < ax) || (cx > ax && bx > ax)) k++;
  if ((cy < ay && by < ay) || (cy > ay && by > ay)) k++;
  if (k == 2)
    cout << "YES\n";
  else
    cout << "NO\n";
}
