#include <bits/stdc++.h>
void swaper(int *a, int *b) {
  *a += *b;
  *b = *a - *b;
  *a -= *b;
  return;
}
int main() {
  int h, w;
  scanf("%d %d", &h, &w);
  if (w > h) {
    swaper(&w, &h);
  }
  int a = h, b = w;
  int cnt1 = 1, cnt2 = 0;
  int c = -1, d = -1;
  int i;
  for (i = 0; i < 5; i++) {
    scanf("%d %d", &h, &w);
    if (w > h) {
      swaper(&w, &h);
    }
    if (h == a && w == b) {
      cnt1++;
    } else if (c != h || d != w) {
      c = h;
      d = w;
      cnt2 = 1;
    } else if (c == h && d == w) {
      cnt2++;
    }
  }
  if (cnt2 > cnt1) {
    swaper(&cnt2, &cnt1);
  }
  if (cnt1 >= 6 || (cnt1 == 4 && cnt2 == 2)) {
    puts("Yes");
  } else {
    puts("No");
  }
  return 0;
}
