#include <bits/stdc++.h>
using namespace std;
int main() {
  int tmp;
  cin >> tmp;
  int a, b;
  cin >> a >> b;
  int x, y;
  cin >> x >> y;
  int n, m;
  cin >> n >> m;
  if (a > x && n > x && a < n) return cout << "NO\n", 0;
  if (a < x && n < x && a > n) return cout << "NO\n", 0;
  if (b > y && m > y && b < m) return cout << "NO\n", 0;
  if (b < y && m < y && b > m) return cout << "NO\n", 0;
  return cout << "YES\n", 0;
}
