#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void chkmax(T& x, U y) {
  if (x < y) x = y;
}
template <typename T, typename U>
inline void chkmin(T& x, U y) {
  if (y < x) x = y;
}
int main() {
  int h, m, s, A, B;
  scanf("%d%d%d%d%d", &h, &m, &s, &A, &B);
  double a = h % 12 + 1.0 * m / 60 + 1.0 * s / 3600;
  double b = 0.2 * m + 1.0 * s / 300;
  double c = 0.2 * s;
  for (int i = 0; i < 2; i++) {
    bool flg = 1;
    for (int x = A; x != B; x = x % 12 + 1) {
      if (x % 12 <= a && a <= x % 12 + 1) flg = 0;
      if (x % 12 <= b && b <= x % 12 + 1) flg = 0;
      if (x % 12 <= c && c <= x % 12 + 1) flg = 0;
    }
    if (flg) return puts("yes"), 0;
    swap(A, B);
  }
  puts("no");
  return 0;
}
