#include <bits/stdc++.h>
using namespace std;
template <typename T>
void ri(T& x);
int n, a, x, b, y;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> a >> x >> b >> y;
  int i, j;
  for (i = a, j = b; i != x && j != y;) {
    if (i == j) {
      printf("YES\n");
      return 0;
    }
    if (++i > n) i = 1;
    if (--j == 0) j = n;
  }
  if (i == j) {
    printf("YES\n");
    return 0;
  }
  printf("NO\n");
  return 0;
}
template <typename T>
void ri(T& x) {
  char c;
  bool minus = false;
  while ((c = getchar()) < '0' || '9' < c)
    if (c == '-') minus = true;
  x = c - '0';
  while ('0' <= (c = getchar()) && c <= '9') x = 10 * x - '0' + c;
  if (minus) x = -x;
}
