#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long m;
  long long n, k = 0, k1 = 0, k0 = 0, sm = 0, nm = 0, sm_original = 0, f = 0,
               mx = 0, t;
  char c;
  string s;
  cin >> n;
  long long a, x, b, y;
  cin >> a >> x >> b >> y;
  while (a != x && b != y) {
    if (a == n)
      a = 1;
    else
      a++;
    if (b == 1)
      b = n;
    else
      b--;
    if (a == b) return cout << "YES", 0;
  }
  cout << "NO";
}
