/**
 *   @FileName	a.cpp
 *   @Author	kanpurin
 *   @Created	2020.10.16 22:11:59
**/

#include "bits/stdc++.h" 
using namespace std; 
typedef long long ll;

int main() {
    vector<int> a(3),b(3);
    for (int i = 0; i < 3; i++) {
        cin >> a[i];
    }
    for (int i = 0; i < 3; i++) {
        cin >> b[i];
    }
    sort(a.begin(), a.end());
    sort(b.begin(), b.end());
    if (a[0] == b[0] && a[1] == b[1] && a[2] == b[2]) {
        puts("Yes");
        cout << 2 << endl;
    }
    else {
        puts("No");
    }
    return 0;
}