#include <bits/stdc++.h>
using namespace std;
int main(void) {
  char gava;
  double xa, ya, xb, yb, xc, yc, xd, yd;
  double a, b;
  int flag;
  while (cin >> xa >> gava >> ya >> gava >> xb >> gava >> yb >> gava >> xc >>
         gava >> yc >> gava >> xd >> gava >> yd) {
    flag = 1;
    if (xa - xc == 0)
      a = 0;
    else
      a = (ya - yc) / (xa - xc);
    if (xa * xc == 0)
      b = 0;
    else
      b = (xa * yc - ya * xc) / (xa * xc);
    if (yd < a * xd + b && yb < a * xb + b ||
        yd > a * xd + b && yb > a * xb + b)
      flag = 0;
    if (xb - xd == 0)
      a = 0;
    else
      a = (yb - yd) / (xb - xd);
    if (xb * xd == 0)
      b = 0;
    else
      b = (xb * yd - yb * xd) / (xb * xd);
    if (yc < a * xc + b && ya < a * xa + b ||
        yc > a * xc + b && ya > a * xa + b)
      flag = 0;
    if (flag == 1)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
