#include <iostream>
#include <vector>
using namespace std;

bool check(int p1, int p2, int p3, int p4){
    vector<bool> c(4, false);
    c[p1 - 1] = true;
    c[p2 - 1] = true;
    c[p3 - 1] = true;
    c[p4 - 1] = true;
    for (int i = 0; i < 4; ++i){
        if (!c[i]) return false;
    }
    return true;
}

int main(){
    vector<pair<int, int>> p(3);
    for (int i = 0; i < 3; ++i){
        cin >> p[i].first >> p[i].second;
    }

    
    for (int i = 0; i < 3; ++i){
        //p[i].first -> p[i].second
        for (int j = 0; j < 3; ++j){
            if (i == j) continue;
            //p[j].first -> p[j].second
            if (p[i].second == p[j].first){
                for (int k = 0; k < 3; ++k){
                    if ((i == k) || (j == k)) continue;
                    //p[k].first -> p[k].second
                    if (p[j].second == p[k].first){
                       if (check(p[i].first,p[i].second,p[j].second,p[k].second)){
                           cout << "YES" << endl;
                           return 0;
                        }
                    }
                    //p[k].second -> p[k].first
                    if (p[j].second == p[k].second){
                       if (check(p[i].first,p[i].second,p[j].second,p[k].first)){
                           cout << "YES" << endl;
                           return 0;
                        }
                    }
                }
            }
            //p[j].second -> p[j].first
            if (p[i].second == p[j].second){
                for (int k = 0; k < 3; ++k){
                    if ((i == k) || (j == k)) continue;
                    //p[k].first -> p[k].second
                    if (p[j].first == p[k].first){
                       if (check(p[i].first,p[i].second,p[j].first,p[k].second)){
                           cout << "YES" << endl;
                           return 0;
                        }
                    }
                    //p[k].second -> p[k].first
                    if (p[j].first == p[k].second){
                       if (check(p[i].first,p[i].second,p[j].first,p[k].first)){
                           cout << "YES" << endl;
                           return 0;
                        }
                    }
                }
            }
        }
        //p[i].second -> p[i].first
        for (int j = 0; j < 3; ++j){
            if (i == j) continue;
            //p[j].first -> p[j].second
            if (p[i].first == p[j].first){
                for (int k = 0; k < 3; ++k){
                    if ((i == k) || (j == k)) continue;
                    //p[k].first -> p[k].second
                    if (p[j].second == p[k].first){
                       if (check(p[i].second,p[i].first,p[j].second,p[k].second)){
                           cout << "YES" << endl;
                           return 0;
                        }
                    }
                    //p[k].second -> p[k].first
                    if (p[j].second == p[k].second){
                       if (check(p[i].second,p[i].first,p[j].second,p[k].first)){
                           cout << "YES" << endl;
                           return 0;
                        }
                    }
                }
            }
            //p[j].second -> p[j].first
            if (p[i].first == p[j].second){
                for (int k = 0; k < 3; ++k){
                    if ((i == k) || (j == k)) continue;
                    //p[k].first -> p[k].second
                    if (p[j].first == p[k].first){
                       if (check(p[i].second,p[i].first,p[j].first,p[k].second)){
                           cout << "YES" << endl;
                           return 0;
                        }
                    }
                    //p[k].second -> p[k].first
                    if (p[j].first == p[k].second){
                       if (check(p[i].second,p[i].first,p[j].first,p[k].first)){
                           cout << "YES" << endl;
                           return 0;
                        }
                    }
                }
            }
        }
    }
    cout << "NO" << endl;
    return 0;
}

Measured memory_bytes: 256