#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target( \
    "sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native"
using namespace std;
int main() {
  long long tc, num, t = 1, choose;
  long long n, a, x, b, y;
  cin >> n >> a >> x >> b >> y;
  a--, x--, b--, y--;
  if (a == b) return cout << "YES" << endl, 0;
  while (true) {
    if (a == b) return cout << "YES" << endl, 0;
    if (a == x || b == y) break;
    a = (a + 1) % n;
    b = (b - 1 + n) % n;
  }
  cout << "NO" << endl;
  return 0;
}
