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