#include <bits/stdc++.h>
using namespace std;
pair<int, int> a, b, c;
int main() {
  int n;
  scanf("%d", &n);
  ;
  scanf("%d", &a.first);
  ;
  scanf("%d", &a.second);
  ;
  scanf("%d", &b.first);
  ;
  scanf("%d", &b.second);
  ;
  scanf("%d", &c.first);
  ;
  scanf("%d", &c.second);
  ;
  if ((b.first - a.first) * (c.first - a.first) < 0 ||
      (b.second - a.second) * (c.second - a.second) < 0)
    cout << "NO";
  else
    cout << "YES";
  return 0;
}
