#include <cstdio>
#include <algorithm>

using namespace std;

int main(){
	//判断y1,m1,d1是不是在ymd后面 
	int y,m,d;
	int y1,m1,d1;
	scanf("%d %d %d",&y,&m,&d);
	scanf("%d %d %d",&y1,&m1,&d1);
	int sum = y*10000+m*100+d;
	int sum1 = y1*10000+m1*100+d1;
	if(sum <= sum1){
		printf("yes\n");
	} 
	else{
		printf("no\n");
	}

	return 0;
}