#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, x, b, y;
  cin >> n >> a >> x >> b >> y;
  bool end = false;
  bool ok = false;
  while (true) {
    if (a == b) {
      ok = true;
      break;
    }
    if (a == x || b == y) break;
    a = (a + 1) % (n + 1);
    b = (b - 1 + n) % n;
    if (a == 0) a = 1;
    if (b == 0) b = n;
  }
  cout << (ok ? "YES" : "NO") << '\n';
  return 0;
}
