import std.stdio, std.range, std.random, std.conv, std.string, std.math;
import std.algorithm.comparison, std.algorithm.iteration, std.algorithm.mutation, std.algorithm.searching, std.algorithm.sorting;

void main()
{
    int[5] l;
    foreach(i; 0..3) {
        int[] input = readln().strip.split().to!(int[]);
        l[input[0]]++;
        l[input[1]]++;
    }
    writeln(
        (
        l[1]<3 &&
        l[2]<3 &&
        l[3]<3 &&
        l[4]<3) ? "YES" : "NO");
}