#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, a, x, b, y;
  cin >> n >> a >> x >> b >> y;
  int f = 0;
  for (int i = 0; i < n; i++) {
    if (a == n) {
      a = 1;
    } else {
      a++;
    }
    if (b == 1) {
      b = n;
    } else {
      b--;
    }
    if (a == b) {
      f = 1;
      break;
    }
    if (a == x || b == y) {
      break;
    }
  }
  if (f)
    cout << "YES\n";
  else
    cout << "NO\n";
}
