#include <bits/stdc++.h>
using namespace std;
int main() {
  double h, m, s, t1, t2;
  cin >> h >> m >> s >> t1 >> t2;
  if (m + s > 0) h += 0.5;
  if (s > 0) m += 0.5;
  m /= 5;
  s /= 5;
  double a, b, c;
  if (h <= m && h <= s) {
    a = h;
    if (m <= s) {
      b = m;
      c = s;
    } else {
      b = s;
      c = m;
    }
  } else if (m <= h && m <= s) {
    a = m;
    if (h <= s) {
      b = h;
      c = s;
    } else {
      b = s;
      c = h;
    }
  } else {
    a = s;
    if (m <= h) {
      b = m;
      c = h;
    } else {
      b = h;
      c = m;
    }
  }
  int p1, p2;
  if (t1 > a && t1 < b)
    p1 = 1;
  else if (t1 > b && t1 < c)
    p1 = 2;
  else
    p1 = 3;
  if (t2 > a && t2 < b)
    p2 = 1;
  else if (t2 > b && t2 < c)
    p2 = 2;
  else
    p2 = 3;
  if (p1 == p2)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
