#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, a, b, x, y, ta, tb, f;
  cin >> n >> a >> x >> b >> y;
  ta = a;
  tb = b;
  while (1) {
    if (ta == tb) {
      f = 1;
      break;
    }
    if ((ta == x) || (tb == y)) {
      f = 0;
      break;
    }
    ta = (ta + 1) % (n + 1);
    if (ta == 0) ta = 1;
    if (tb == 1)
      tb = n;
    else
      tb--;
  }
  if (f)
    cout << "YES\n";
  else
    cout << "NO\n";
}
