#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, a, x, b, y;
  scanf("%d%d%d%d%d", &n, &a, &x, &b, &y);
  vector<int> list1, list2;
  int now = a;
  while (1) {
    if (now > n) now = 1;
    list1.push_back(now);
    if (now == x) break;
    ++now;
  }
  now = b;
  while (1) {
    if (now < 1) now = n;
    list2.push_back(now);
    if (now == y) break;
    --now;
  }
  bool flag = false;
  for (int i = 0; i < list1.size() && i < list2.size(); ++i) {
    if (list1[i] == list2[i]) {
      flag = true;
      break;
    }
  }
  if (flag)
    printf("YES\n");
  else
    printf("NO\n");
}
int main(void) {
  solve();
  return 0;
}
