#include<iostream>
#include<algorithm>
using namespace std;
char a[100000],b[100000];
int main()
{
int i,j;
while (cin>>a>>b)
{
for (i=0;i<strlen(a);i++)
{
if (a[i]=='.')
break;
}
if (i!=strlen(a))
{
for (j=strlen(a)-1;j>=i;j--)
if (a[j]=='0'||a[j]=='.')
a[j]='\0';
else
break;
}
for (i=0;i<strlen(b);i++)
{
if (b[i]=='.')
break;
}
if (i!=strlen(b))
{
for (j=strlen(b)-1;j>=i;j--)
if (b[j]=='0'||b[j]=='.')
b[j]='\0';
else
break;
}
// cout<<strlen(a)<<" "<<strlen(b)<<endl;
if(!strcmp(a,b))
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
return 0;
}