#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, a, x, b, y;
  cin >> n >> a >> x >> b >> y;
  while (1) {
    if (a == b) {
      cout << "YES\n";
      return 0;
    }
    if (a == x || b == y) {
      break;
    }
    if (++a > n) {
      a = 1;
    }
    if (--b < 1) {
      b = n;
    }
  }
  cout << "NO\n";
  return 0;
}
