#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, x, b, y;
  cin >> n >> a >> x >> b >> y;
  int ai = a, bi = b, f = 0;
  for (int i = 0; i < n; i++) {
    if (ai == bi) {
      f = 1;
      break;
    }
    if (ai == x || bi == y) {
      break;
    }
    ai++;
    bi--;
    if (ai == n + 1) ai = 1;
    if (bi == 0) bi = n;
  }
  if (f == 1)
    cout << "YES"
         << "\n";
  else
    cout << "NO"
         << "\n";
  return 0;
}
