#include <bits/stdc++.h>
using namespace std;
int aa[105];
int main() {
  int n, a, x, b, y;
  cin >> n >> a >> x >> b >> y;
  for (int i = (1); i < (n + 1); i++) aa[i] = -1;
  int c = 0, i = a;
  while (aa[i] == -1) {
    aa[i] = c++;
    if (i == x) break;
    if (i == n)
      i = 1;
    else
      i++;
  }
  i = b;
  c = 0;
  while (aa[i] != c) {
    c++;
    if (i == y) break;
    if (i == 1)
      i = n;
    else
      i--;
  }
  if (aa[i] == c) {
    cout << "YES";
  } else
    cout << "NO";
}
