#include <bits/stdc++.h>
using namespace std;
double distance(double x0, double y0, double x1, double y1) {
  double x = x1 - x0;
  double y = y1 - y0;
  return sqrt(x * x + y * y);
}
double angle(double b, double c, double a) {
  return acos((b * b + c * c - a * a) / (2 * b * c)) * (180 / M_PI);
}
int main() {
  string s;
  for (; getline(cin, s);) {
    stringstream ss;
    ss << s;
    vector<double> x(4);
    vector<double> y(4);
    for (int i = 0; i < 4; i++) {
      ss >> x.at(i);
      ss.ignore();
      ss >> y.at(i);
      ss.ignore();
    }
    double a = distance(x.at(0), y.at(0), x.at(1), y.at(1));
    double b = distance(x.at(1), y.at(1), x.at(2), y.at(2));
    double c = distance(x.at(2), y.at(2), x.at(3), y.at(3));
    double d = distance(x.at(3), y.at(3), x.at(0), y.at(0));
    double e0 = distance(x.at(0), y.at(0), x.at(2), y.at(2));
    double e1 = distance(x.at(1), y.at(1), x.at(3), y.at(3));
    if ((e0 < a && e0 < b) || (e0 < c && e0 < d) || (e1 < a && e1 < d) ||
        (e1 < b && e1 < c)) {
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
    }
  }
}
