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