#include <bits/stdc++.h>
using namespace std;
long long binarySearch(long long arr[], long long l, long long r, long long x) {
  if (r >= l) {
    long long mid = l + (r - l) / 2;
    if (arr[mid] == x) return mid;
    if (arr[mid] > x) return binarySearch(arr, l, mid - 1, x);
    if (arr[mid] < x) return binarySearch(arr, mid + 1, r, x);
  }
  return -1;
}
long long fact(long long n) {
  if (n == 0 || n == 1)
    return 1;
  else
    return n * fact(n - 1);
}
long long ncr(long long n, long long r) {
  if (r < 0 || r > n) return 0;
  if (r == 0)
    return 1;
  else
    return (n * ncr(n - 1, r - 1)) / r;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
bool isPrime(int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (int i = 5; i * i <= n; i = i + 6) {
    if (n % i == 0 || n % (i + 2) == 0) {
      return false;
    }
  }
  return true;
}
bool isPowerOfTwo(long long n) {
  if (n == 0) return false;
  return (ceil(log2(n)) == floor(log2(n)));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  std::cout << std::fixed;
  std::cout << std::setprecision(9);
  long long testcases;
  testcases = 1;
  while (testcases--) {
    long double h, m, s, t1, t2, o, p, z = 0;
    cin >> h >> m >> s >> t1 >> t2;
    o = ((t1 > t2) ? t2 : t1);
    p = ((t1 > t2) ? t1 : t2);
    if (o <= h && p > h) z++;
    if (o * 5 <= m && p * 5 > m) z++;
    if (o * 5 < s && p * 5 > s) z++;
    cout << ((z < 3 && z > 0) ? "NO" : "YES");
  }
  return 0;
}
