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