#include <bits/stdc++.h>
double EPS = 1e-10;
double add(double a, double b) {
  if (abs(a + b) < EPS * (abs(a) + abs(b))) return 0;
}
struct P {
  double x, y;
  P() {}
  P(double x, double y) : x(x), y(y) {}
  P operator+(P p) { return P(x + p.x, y + p.y); }
  P operator-(P p) { return P(x - p.x, y - p.y); }
  P operator*(double d) { return P(x * d, y * d); }
  double dot(P p) { return (x * (p.x) + y * (p.y)); }
  double det(P p) { return (x * p.y - y * p.x); }
  P turn(double theta) { return P(x * cos(theta), y * sin(theta)); }
  void output() {
    printf("(x,y)=%f %f\n", x, y);
    return;
  }
};
bool on_seg(P p1, P p2, P q) {
  return (fabs((p1 - q).det(p2 - q)) == 0 && (p1 - q).dot(p2 - q) <= 0);
}
P intersection(P p1, P p2, P q1, P q2) {
  return p1 + (p2 - p1) * ((q2 - q1).det(q1 - p1) / (q2 - q1).det(p2 - p1));
}
using namespace std;
int main() {
  P p1, p2, p3, p4;
  char t;
  while (cin >> p1.x >> t >> p1.y >> t >> p2.x >> t >> p2.y >> t >> p3.x >> t >>
         p3.y >> t >> p4.x >> t >> p4.y) {
    P koten = intersection(p1, p3, p2, p4);
    if (on_seg(p1, p3, koten) && on_seg(p2, p4, koten)) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}
