#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
const long long inf = 1e9 + 7;
long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return f * x;
}
int n, a, b, x, y;
int main() {
  n = read();
  a = read();
  x = read();
  b = read();
  y = read();
  while (a != x && b != y) {
    a = (a + 1) % n;
    if (a == 0) a = n;
    b = (b - 1 + n) % n;
    if (b == 0) b = n;
    if (a == b) return puts("YES");
  }
  puts("NO");
  return 0;
}
