#include <iostream>
using namespace std;
int main()
{
string a, b;
getline(cin, a);
getline(cin, b);
string s1 = "", s2 = "";
for (int i = 0; i < a.size(); i++)
{
if (a[i] == ' ')
continue;
if (a[i] >= 'a')
a[i] -= 32;
s1 += a[i];
}
for (int i = 0; i < b.size(); i++)
{
if (b[i] == ' ')
continue;
if (b[i] >= 'a')
b[i] -= 32;
s2 += b[i];
}
if (s1 == s2)
cout << "YES";
else
cout << "NO";
return 0;
}