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