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