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