#include <bits/stdc++.h>
using namespace std;
int main() {
  int h, m, s, t1, t2, min, max, count = 0;
  cin >> h >> m >> s >> t1 >> t2;
  float a1, a2, a3, a4, a5;
  a1 = (1.00000) * h;
  a2 = (0.20000) * m;
  a3 = (0.20000) * s;
  a1 = a1 + (a2 / (60.000)) + (a3 / (3600.000));
  a2 = a2 + (a3 / (60.000));
  if (t1 <= t2) {
    min = (1.00000) * t1;
    max = (1.00000) * t2;
  } else if (t1 > t2) {
    min = (1.00000) * t2;
    max = (1.00000) * t1;
  }
  if (a1 >= min && a1 <= max) count++;
  if (a2 >= min && a2 <= max) count++;
  if (a3 >= min && a3 <= max) count++;
  if (count == 0 || count == 3)
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
