#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, A, X, B, Y;
  cin >> N >> A >> X >> B >> Y;
  while (A != X && B != Y) {
    if (A == B) {
      cout << "YES" << endl;
      exit(0);
    }
    A++;
    if (A > N) A = 1;
    B--;
    if (B == 0) B = N;
  }
  if (A == B) {
    cout << "YES" << endl;
    exit(0);
  }
  cout << "NO" << endl;
}
