#include <bits/stdc++.h>
using namespace std;
long long modulo(long long num, long long MOD = 1000000007) {
  return ((num % MOD) + MOD) % MOD;
}
long long power(long long b, long long e, long long MOD = 1000000007) {
  long long ans = 1;
  while (e) {
    if (e % 2) ans = (ans * b) % MOD;
    b = (b * b) % MOD;
    e /= 2;
  }
  return ans;
}
long long inv(long long num, long long MOD = 1000000007) {
  return power(modulo(num), MOD - 2, MOD);
}
int main() {
  cout << fixed << setprecision(8);
  int n, a, x, b, y;
  cin >> n >> a >> x >> b >> y;
  int tt = 200;
  bool f = 0;
  while (tt--) {
    a += 1;
    if (a > n) a = 1;
    b -= 1;
    if (b < 1) b = n;
    if (a == b) {
      f = 1;
      break;
    }
    if (a == x || b == y) break;
  }
  if (f)
    cout << "YES";
  else
    cout << "NO";
}
