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