#include<iostream>
using namespace std;
int main(){

  double ax,ay,bx,by,cx,cy,dx,dy;
  char d;
  while(cin>>ax>>d>>ay>>d>>bx>>d>>by>>d>>cx>>d>>cy>>d>>dx>>d>>dy!='\0'){
    if(ay>dy||by<cy||bx<cx||dx<ax||(bx==cx&&ay==dy)||(ax==dx&&ay==dy)||(bx==cx)&&(by==cy)||(ax==dx&&by==cy))
      cout << "NO" << endl;
    else
      cout << "YES" << endl;

  }

}