#include <bits/stdc++.h>
using namespace std;
int w[105];
int main() {
  int n, a, x, b, y;
  cin >> n >> a >> x >> b >> y;
  if (x < a) {
    x = x + n;
  }
  int t = 1;
  for (int i = a; i <= x; i++) {
    int station = i % n;
    if (station == 0) station = n;
    w[station] = t;
    t++;
  }
  if (y > b) b = b + n;
  int t2 = 1;
  int f = 0;
  for (int i = b; i >= y; i--) {
    int station = i % n;
    if (station == 0) station = n;
    if (w[station] == t2) {
      f = 1;
      break;
    }
    t2++;
  }
  if (f)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
