#include <bits/stdc++.h>
using namespace std;
int n, a, x, b, y;
int vis[110];
int main() {
  scanf("%d%d%d%d%d", &n, &a, &x, &b, &y);
  int cnt = 1;
  for (int i = a; i != x; i++) {
    if (i == n + 1) i = 1;
    if (i == x) break;
    vis[i] = cnt++;
  }
  vis[x] = cnt;
  cnt = 1;
  for (int i = b; i != y; i--) {
    if (i == 0) i = n;
    if (i == y) break;
    if (vis[i] == cnt) return printf("YES"), 0;
    cnt++;
  }
  if (vis[y] == cnt) return printf("YES"), 0;
  printf("NO");
  return 0;
}
