#include //#include using namespace std; //using namespace atcoder; using ll = long long; using ull = unsigned long long; using P = pair; #define rep(i,n) for(ll i = 0;i < (ll)n;i++) #define ALL(x) (x).begin(),(x).end() #define MOD 1000000007 int main(){ vector v(3),w(3); rep(i,3)cin >> v[i]; rep(i,3)cin >> w[i]; sort(ALL(v)); sort(ALL(w)); cout << (v == w ? "2\n" : "No\n"); return 0; }