#include <bits/stdc++.h>
using namespace std;
int check(long long a1, long long a2) {
  if (a1 < 0 && a2 < 0) {
    return 3;
  } else if (a1 > 0 && a2 > 0) {
    return 1;
  } else if (a1 < 0 && a2 > 0) {
    return 2;
  } else
    return 4;
}
int main() {
  long long t, i, j, k, l, m, n, p, q, r, s = 0, a, b, c, d, ans = 0, x, y;
  long long a1, a2, b1, b2, c1, c2;
  cin >> n >> a1 >> a2 >> b1 >> b2 >> c1 >> c2;
  b1 -= a1;
  c1 -= a1;
  b2 -= a2;
  c2 -= a2;
  if (check(b1, b2) == check(c1, c2)) {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
}
