import std.stdio;


void main() {
  auto xs = new int[4];
  int a, b;
  foreach (_; 0..3) {
    readf("%d %d\n", &a, &b);
    xs[a-1]++;
    xs[b-1]++;
  }

  int e = 0, o = 0;
  foreach (x; xs) {
    if (x % 2 == 0) {
      e++;
    } else {
      o++;
    }
  }

  if (o == 0 || o == 2) {
    writeln("YES");
  } else {
    writeln("NO");
  }
}
