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