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