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