#include <bits/stdc++.h>
int n, a, x, b, y;
int main() {
  int k = 0;
  scanf("%d%d%d%d%d", &n, &a, &x, &b, &y);
  while (a != x && b != y) {
    a++;
    b--;
    if (a > n) a %= n;
    if (b == 0) b = n;
    if (b == a) {
      printf("YES\n");
      k = 1;
      break;
    }
  }
  if (k == 0) printf("NO\n");
  return 0;
}
