#include #include using namespace std; int main() { string a, b; cin >> a >> b; int c = 0; for (int i = 0; i < a.length(); i++) { for (int j = 0; j < a.length(); j++) { if (a[i] == b[j]) { c++; break; } } } if (c == a.length()) { cout << "YES" << endl; } else { cout << "NO" << endl; } }