#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10, INF = 0x3f3f3f3f;
const long long mod = 1e9 + 7, LINF = 0x3f3f3f3f3f3f3f3f;
;
const double eps = 1e-8, Pi = 2 * acos(0);
int n, m;
int mark[150];
void solve() {
  int a, b, x, y;
  scanf("%d", &n);
  scanf("%d%d", &a, &x);
  scanf("%d%d", &b, &y);
  int c = a;
  int t = 1;
  while (c != x) {
    c++;
    if (c > n) c -= n;
    mark[c] = t;
    t++;
  }
  c = b;
  t = 1;
  while (c != y) {
    c--;
    if (c <= 0) c += n;
    if (mark[c] == t) {
      printf("YES\n");
      return;
    }
    t++;
  }
  printf("NO\n");
}
int main() {
  int ce, c = 1, flag = 1;
  solve();
  return 0;
}
