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