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