#include using namespace std; int main(){ int A, B, C; cin >> A >> B >> C; int D, E, F; cin >> D >> E >> F; if (A == D && B == E && C == F){ cout << "Yes" << endl; } else { vector a = {A, B, C}; vector b = {D, E, F}; sort(a.begin(), a.end()); sort(b.begin(), b.end()); if (a == b){ cout << "Yes" << endl; cout << 2 << endl; } else { cout << "No" << endl; } } }