#include <bits/stdc++.h>
using namespace std;
int main() {
  int h, m, s, a, b, c, d;
  cin >> h >> m >> s;
  cin >> a >> b;
  m = m / 5;
  s = s / 5;
  int w1, w2;
  w1 = w2 = 0;
  if (b > a) {
    if (h >= a && h < b)
      w2 = 1;
    else
      w1 = 1;
    if (m >= a && m < b)
      w2 = 1;
    else
      w1 = 1;
    if (s >= a && s < b)
      w2 = 1;
    else
      w1 = 1;
  } else {
    if (h < a && h >= b)
      w2 = 1;
    else
      w1 = 1;
    if (m < a && m >= b)
      w2 = 1;
    else
      w1 = 1;
    if (s < a && s >= b)
      w2 = 1;
    else
      w1 = 1;
  }
  if (w1 == 0 || w2 == 0)
    cout << "YES";
  else
    cout << "NO";
  cout << endl;
  return 0;
}
