#include <bits/stdc++.h>
using namespace std;
bool notCommon(int n, int a, int x, int b, int y) {
  int i = a, j = b;
  if (i == j) return true;
  while (i != x && j != y) {
    i = (i + 1) % (n);
    j--;
    if (j == -1) j = n - 1;
    if (i == j) return true;
  }
  return false;
}
int main() {
  int n, a, x, b, y;
  cin >> n >> a >> x >> b >> y;
  if (!notCommon(n, a - 1, x - 1, b - 1, y - 1)) {
    cout << "NO" << endl;
  } else
    cout << "YES" << endl;
}
