#include <bits/stdc++.h>
int main() {
  double x1, x2, x3, x4, y1, y2, y3, y4;
  double A, B, C, D, tmp;
  while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &x1, &y1, &x2, &y2, &x3, &y3,
               &x4, &y4) != EOF) {
    if (x1 > x3) {
      tmp = x1;
      x1 = x3;
      x3 = tmp;
      tmp = y1;
      y1 = y3;
      y3 = tmp;
    }
    if (y2 > y4) {
      tmp = x2;
      x2 = x4;
      x4 = tmp;
      tmp = y2;
      y2 = y4;
      y4 = tmp;
    }
    A = x1 * (x2 - x4) * (y1 - y3) - x2 * (x1 - x3) * (y2 - y4) +
        (y2 - y1) * (x1 - x3) * (x2 - x4);
    B = (y1 - y3) * (x2 - x4) - (y2 - y4) * (x1 - x3);
    C = (y1 - y3) * (A - B * x1) + y1 * B * (x1 - x3);
    D = B * (x1 - x3);
    if (B < 0) {
      B *= -1.0;
      A *= -1.0;
    }
    if (D < 0) {
      D *= -1.0;
      C *= -1.0;
    }
    if ((B * x1 < A && A < B * x3) && (D * y2 < C && C < D * y4)) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  }
  return 0;
}
