#include <bits/stdc++.h>
int main() {
  int N;
  std::cin >> N;
  int qX, qY, startX, startY, endX, endY;
  std::cin >> qX >> qY >> startX >> startY >> endX >> endY;
  int startDeltaX = startX - qX;
  int startDeltaY = startY - qY;
  int endDeltaX = endX - qX;
  int endDeltaY = endY - qY;
  if (startDeltaX * endDeltaX < 0 || startDeltaY * endDeltaY < 0) {
    std::cout << "NO\n";
  } else {
    std::cout << "YES\n";
  }
  return 0;
}
