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