#include <stdio.h>

int main() {
    int y,m,d,y1,m1,d1;
    scanf("%d %d %d%d %d %d",&y,&m,&d,&y1,&m1,&d1);
    if((y1*10000+m1*100+d1)>=(y*10000+m*100+d))
    printf("yes\n");
    else
     printf("no\n");
    return 0;
}