#include <bits/stdc++.h>
using namespace std;
int main() {
  int h, m, s, t1, t2, c = 0;
  cin >> h >> m >> s >> t1 >> t2;
  if (t1 > t2) swap(t1, t2);
  if (t1 <= h && h < t2) c++;
  if (5 * t1 <= m && m < 5 * t2) c++;
  if (5 * t1 <= s && s < 5 * t2) c++;
  if (c == 0 || c == 3)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
