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