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