#include <bits/stdc++.h>
using namespace std;
const int inf = 2147483647;
int a, b, c;
int fr, tt;
int main() {
  cin >> a >> b >> c;
  cin >> fr >> tt;
  if (b != 0 || c != 0) a++;
  if (a == 13) a = 1;
  b = b / 5 + 1;
  if (b == 13) b = 1;
  c = c / 5 + 1;
  if (c == 13) c = 1;
  if (fr > tt) swap(fr, tt);
  bool ok = 1;
  for (int i = fr + 1; i <= tt; i++) {
    if (a == i || b == i || c == i) {
      ok = 0;
      break;
    }
  }
  if (ok) {
    cout << "YES" << endl;
    return 0;
  }
  int i = tt;
  while (i != fr) {
    i++;
    if (i == 13) i = 1;
    if (a == i || b == i || c == i) {
      ok = 1;
      break;
    }
  }
  if (!ok) {
    cout << "YES" << endl;
    return 0;
  }
  puts("NO");
  return 0;
}
