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