#include <iostream>
#include <sstream>
#include <algorithm>
#include <cstdio>
#include <string>
#include <vector>
#include <cmath>

#define rep(x,to) for(int x=0;x<to;x++)
#define rep2(x,from,to) for(int x=from;x<to;x++)

using namespace std;


int main(void){

int a,b;
	while(!cin.eof()){
		if(cin.eof()) goto endrt;
		int zz[101]={0};
		int ing=-999, oug;
		while(cin >> a >>b){
			if(a==0 && b==0) break;
			if(cin.eof()) goto endrt;
			zz[a]++;
			zz[b]++;
			oug=b; if(ing<0) ing=a;
		}
		bool ans=true;
		if(!(zz[ing] % 2 && zz[oug] % 2 )) ans=false;
		rep(i,101) if(i != ing && i != oug && zz[i] % 2 ) ans=false;
//		rep(i,101) if(zz[i] > 0){printf("%d:%d, ",i,zz[i]); } printf("\n"); 
		if(ing>0) cout << (ans? "YES": "NO") << endl;
	
	}
	endrt:
	return 0;
	
}