#include using namespace std; #define REP(i,a,n) for(int i=(a); i<(int)(n); i++) #define rep(i,n) REP(i,0,n) #define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it) #define ALLOF(c) (c).begin(), (c).end() typedef long long ll; typedef unsigned long long ull; int main(){ int A, B, C; int D, E, F; cin >> A >> B >> C; cin >> D >> E >> F; vector v = {A,B,C}; vector w = {D,E,F}; sort(ALLOF(v)); sort(ALLOF(w)); if(v[0] == w[0] && v[1] == w[1] && v[2] == w[2]){ cout << "Yes" << endl; cout << 2 << endl; return 0; } cout << "No" << endl; return 0; }