#include <bits/stdc++.h>
using namespace std;
int main() {
  double h, m, s, t1, t2, flag = 1;
  cin >> h >> m >> s >> t1 >> t2;
  if (m || s) h += 0.5;
  if (t2 < t1) swap(t1, t2);
  int hh = 0, mm = 0, ss = 0;
  if (h >= t1 && h < t2) hh = 1;
  if (m / 5 >= t1 && m / 5 < t2) mm = 1;
  if (s / 5 >= t1 && s / 5 < t2) ss = 1;
  if ((hh == 1 && mm == 1 && ss == 1) || (hh == 0 && mm == 0 && ss == 0))
    cout << "YES";
  else
    cout << "NO";
}
