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