#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef pair Pr; string A, B; map m; int main() { cin >> A >> B; for (int i = 0; i < B.size(); i++) { if (A.find(B[i]) == string::npos || B.find(A[i]) == string::npos) { cout << "NO" << endl; return 0; } } cout << "YES" << endl; return 0; }