#include<bits/stdc++.h>
using namespace std;
int a[5];
int main()
{
    int x,y;
    cin>>x>>y;a[x]++;a[y]++;
    cin>>x>>y;a[x]++;a[y]++;
    cin>>x>>y;a[x]++;a[y]++;
    bool flag=true;
    for(int i=1;i<=4;i++) if(a[i]>=3) flag=false;
    if(flag) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
}
