#include <bits/stdc++.h>
using namespace std;
int main() {
  int d1, d2, rr1, rr2, cc1, cc2, N, r1, r2, c1, c2;
  cin >> N;
  cin >> d1 >> d2;
  cin >> r1 >> r2;
  cin >> c1 >> c2;
  if (r1 < d1)
    rr1 = -1;
  else
    rr1 = 1;
  if (c1 < d1)
    cc1 = -1;
  else
    cc1 = 1;
  if (r2 < d2)
    rr2 = -1;
  else
    rr2 = 1;
  if (c2 < d2)
    cc2 = -1;
  else
    cc2 = 1;
  if (rr1 == cc1 && rr2 == cc2)
    cout << "YES"
         << "\n";
  else
    cout << "NO"
         << "\n";
}
