#include<bits/stdc++.h>
#include<queue>
using namespace std;
struct sl1{
int a,b,c;
int t;
}al;
int x,y,z;
queue<sl1> q;
bool check(sl1 ml){
if(al.a==x||al.b==x||al.c==x){
if(al.a==y||al.b==y||al.c==y){
if(al.a==z||al.b==z||al.c==z){
return 1;
}
}
}
return 0;
}
int bfs(){
q.push(al);
while(q.size()){
sl1 x=q.front();
q.pop();
if(check(x)){
return x.t;
}
sl1 opt1=x;
sl1 opt2=x;
sl1 opt3=x;
sl1 opt4=x;
sl1 opt5=x;
sl1 opt6=x;
opt1.a=2*opt1.b-opt1.a;
opt1.t++;
q.push(opt1);
opt2.a=2*opt2.c-opt2.a;
opt2.t++;
q.push(opt2);
opt3.b=2*opt3.a-opt1.b;
opt3.t++;
q.push(opt3);
opt4.b=2*opt4.c-opt4.b;
opt4.t++;
q.push(opt4);
opt5.c=2*opt5.a-opt5.c;
opt5.t++;
q.push(opt5);
opt6.c=2*opt6.b-opt6.c;
opt6.t++;
q.push(opt6);
}
return -1;
}
int main(){
cin>>al.a>>al.b>>al.c;
cin>>x>>y>>z;
int out=bfs();
if(out!=-1){
cout<<"YES"<<endl<<out;
}
return 0;
}
我甚至没有判断它能不能跳到那个位置都有分就太逆天力