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