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