#include <bits/stdc++.h>
using namespace std;
int main() {
  float h, m, s, t1, t2;
  cin >> h >> m >> s >> t1 >> t2;
  if (h == 12) {
    h = 0;
  }
  h /= 12;
  m /= 60;
  s /= 60;
  t1 /= 12;
  t2 /= 12;
  h += (m / 12 + s / (12 * 60));
  m += (s / 60);
  float times[3] = {h, m, s};
  sort(times, times + 3);
  if (((times[0] < t1) && (t1 < times[1])) &&
      ((times[0] < t2) && (t2 < times[1]))) {
    cout << "YES";
  } else if (((times[1] < t1) && (t1 < times[2])) &&
             ((times[1] < t2) && (t2 < times[2]))) {
    cout << "YES";
  } else if (((times[2] < t1) || (times[0] > t1)) &&
             ((times[2] < t2) || (times[0] > t2))) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
