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