#include <bits/stdc++.h>
 
using namespace std;

bool check(int a,int b,int c)
{
    if(a==b || a==c || b==c) return false;
  if(b < a && b < c) return true;
  else if(b > a && b > c) return true;
  return false;
}
int main(void) 
{
  cin.tie(0);
  ios::sync_with_stdio(false);

  int a[3],b[3];

  cin >> a[0] >> a[1] >> a[2];
  cin >> b[0] >> b[1] >> b[2];

  for(int i=0;i<3;i++)
  {
    for(int j=0;j<3;j++)
    {
      int temp = a[i];
      a[i] = b[j];
      b[j] = temp;

      if(check(a[0],a[1],a[2]) && check(b[0],b[1],b[2]))
      {
        cout << "Yes" << '\n';
        return 0;
      }
      temp = a[i];
      a[i] = b[j];
      b[j] = temp;
    }
  }
  cout << "No" << '\n';
  return 0;
}