#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10, mod = 1e9 + 7, INF = 0x3f3f3f3f;
int main() {
  int n, a, x, b, y;
  cin >> n >> a >> x >> b >> y;
  while (a != x && b != y) {
    a++;
    if (a > n) a = 1;
    b--;
    if (b < 1) b = n;
    if (a == b) {
      printf("YES");
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
