#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr int Inf = 1000000010;
constexpr ll INF= 2000000000000000000;
constexpr ll MOD = 998244353;
const double PI = 3.1415926535897;
typedef pair<int,int> P;
typedef pair<int,P> PP;

template<class T> inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}

template<class T> inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return 1;
    }
    return 0;
}

ll mod(ll val, ll M) {
    val = val % M;
    if(val < 0) {
        val += M;
    }
    return val;
}

template<typename T>
T RS(T N, T P, T M){
    if(P == 0) {
        return 1;
    }
    if(P < 0) {
        return 0;
    }
    if(P % 2 == 0){
        ll t = RS(N, P/2, M);
        if(M == -1) return t * t;
        return t * t % M;
    }
    if(M == -1) {
        return N * RS(N,P - 1,M);
    }
    return N * RS(N, P-1, M) % M;
}

int main() {
    vector<int> A(3);
    cin >> A.at(0) >> A.at(1) >> A.at(2);
    vector<int> B(3);
    cin >> B.at(0) >> B.at(1) >> B.at(2);
    sort(A.begin(),A.end());
    sort(B.begin(),B.end());
    bool ret = true;
    for(int i = 0;i < 3;i++) {
        if(A.at(i) != B.at(i)) {
            ret = false;
        }
    }
    if(ret == false) {
        cout << "No" << endl;
    }
    else {
        cout << "Yes" << endl;
        cout << 2 << endl;
    }
}