#include <bits/stdc++.h>
double slope(double x1, double x2, double x3, double x4, double y1, double y2,
             double y3, double y4) {
  if (((x1 - x2) * (y3 - y1) + (y1 - y2) * (x1 - x3)) *
          ((x1 - x2) * (y4 - y1) + (y1 - y2) * (x1 - x4)) <
      0) {
    if (((x3 - x4) * (y1 - y3) + (y3 - y4) * (x3 - x1)) *
            ((x3 - x4) * (y2 - y3) + (y3 - y4) * (x3 - x2)) <
        0) {
      return (0);
    }
  } else
    return (1);
}
int main(void) {
  double xa, ya, xb, yb, xc, yc, xd, yd;
  int result1 = 0, result2 = 0;
  while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &xa, &ya, &xb, &yb, &xc, &yc,
               &xd, &yd) != EOF) {
    result1 = slope(xa, xb, xc, xd, ya, yb, yc, yd);
    result2 = slope(xb, xc, xd, xa, yb, yc, yd, ya);
    printf("%d,%d\n", result1, result2);
    if (result1 == 1 && result2 == 1)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
