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