#include <bits/stdc++.h>
using namespace std;
int main() {
string s,t;
cin>>s>>t;
if (s==t) {
cout<<"Yes"<<endl;
}else {
for (int i=0;i<s.length()-1;++i) {
if (s[i]==t[i+1] and s[i+1]t[i] and s[i]!=s[i+1]) {
swap(s[i],s[i+1]);
break;
}
}
if (st) {
cout<<"Yes"<<endl;
}else {
cout<<"No"<<endl;
}
}
return 0;
}