#include<iostream>
main(){for(float a,b,c,d,e,f,g,h;std::cin>>a>>b>>c>>d>>e>>f>>g>>h;)if((((e>g?e:g)-(a<c?a:c))*((a>c?a:c)-(e<g?e:g))<0)||(((f>h?f:h)-(b<d?b:d))*((b>d?b:d)-(f<h?f:h))<0))std::cout<<"NO\n";else std::cout<<"YES\n";}