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