#include <bits/stdc++.h>
using namespace std;
int a[200010];
int t, n;
int MOD = 1e9 + 7;
const int SIZE = 1e6 + 10;
int main() {
  cin >> n;
  int x, y, a, b;
  cin >> a >> x >> b >> y;
  while (a != x && b != y && a != b) {
    if (a < n)
      a++;
    else
      a = 1;
    if (b > 1)
      b--;
    else
      b = n;
  }
  if (a == b) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
