#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, a, x, b, y;
  cin >> n >> a >> x >> b >> y;
  bool check = false;
  while (1) {
    if (a == x || b == y) break;
    a = a + 1;
    b = b - 1;
    if (a > n) a = 1;
    if (b < 1) b = n;
    if (a == b) {
      check = true;
      break;
    }
  }
  if (a == b) check = true;
  if (check)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
