#include<stdio.h>
#include<string.h>
int main()
{
void d(char *s);
char *pa,*pb,a[100000],b[100000];
while(scanf("%s%s",&a,&b)!=EOF)
{
pa=a;
pb=b;
while(*pa=='0')
{
pa++;
}
while(*pb=='0')
{
pb++;
}
d(pa);
d(pb);
printf(strcmp(pa,pb)?"NO\n":"YES\n");
}
return 0;
}
void d(char *s)
{
int len=strlen(s);
char *p=s+len-1;
if(strchr(s,'.'))
{
while(*p=='0')
{
*p--=0;
}
}
if(*p=='.')
{
*p=0;
}
}