#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    int n, a, x, b, y, f = 0, c = 0, d = 0;
    ;
    cin >> n >> a >> x >> b >> y;
    a--;
    b--;
    x--;
    y--;
    int aa[n], bb[n];
    for (int i = 0; i < n; i++) {
      bb[i] = n - 1 - i;
      if (bb[i] == b) c = i;
    }
    while (true) {
      int p = (a + d) % n;
      int q = bb[(c + d) % n];
      if (p == q) f = 1;
      if (p == x || q == y) {
        break;
      }
      d++;
    }
    if (f) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
      continue;
    };
  }
  return 0;
}
