#include <stdio.h> int main(){ int y,m,d; int y1,m1,d1; scanf("%d%d%d",&y,&m,&d); scanf("%d%d%d",&y1,&m1,&d1); if(y1>y)printf("yes"); else if(y1==y){ if(m1>m)printf("yes"); else if(m1==m){ if(d1>=d)printf("yes"); else printf("no"); } else if(m1<=m)printf("no"); } else if(y1<y)printf("no"); return 0; }