#include <bits/stdc++.h>
int main(void) {
  double xa, ya, xb, yb, xc, yc, xd, yd;
  double angle1, angle2;
  double temp;
  double x, y;
  while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &xa, &ya, &xb, &yb, &xc, &yc,
               &xd, &yd) != EOF) {
    if (xa == xc) {
      temp = (yd - yb) * (xa - xb) / (xd - xb) + yb;
      if ((temp > ya && temp > yc) || (temp < ya && temp < yc))
        printf("NO\n");
      else
        printf("YES\n");
    } else if (xb == xd) {
      temp = (yc - ya) * (xb - xa) / (xc - xa) + ya;
      if ((temp > yb && temp > yd) || (temp < yb && temp < yd))
        printf("NO\n");
      else
        printf("YES\n");
    } else {
      angle1 = (yc - ya) / (xc - xa);
      angle2 = (yd - yb) / (xd - xb);
      x = ((angle1 * xa - angle2 * xb) - ya + yb) / (angle1 - angle2);
      y = angle1 * (x - xa) + ya;
      if ((x > xa && x > xc) || (x < xa && x < xc) || (x > xb && x > xd) ||
          (x < xb && x < xd))
        printf("NO\n");
      else
        printf("YES\n");
    }
  }
  return 0;
}
