#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define ALL(x) (x).begin(),(x).end() #define RALL(x) (x).rbegin(), (x).rend() #define rev(i,n) for(int (i)=(n-1);(i)>=0;(i)--) #define repp(i,n) for(int (i)=1;(i)<=(n);(i)++) #define rep(i,n) for(int (i)=0;(i)<(n);(i)++) #define rev(i,n) for(int (i)=(n-1);(i)>=0;(i)--) #define clr(a) memset((a), 0 ,sizeof(a)) typedef pair P; typedef vector > pii; typedef map mi; int main(){ int x,y,z; char c; vector vc(3),vc2(3); cin >> vc[0] >> c >> vc[1] >> c >> vc[2]; cin >> vc2[0] >> c >> vc2[1] >> c >> vc2[2]; cout << (vc>=vc2?"YES":"NO") << endl; return 0; }