#include <bits/stdc++.h>
using namespace std;
const long long sz = 5e4 + 5;
int main() {
  int n, a, x, b, y;
  cin >> n >> a >> x >> b >> y;
  int yes = 0;
  for (int i = a, j = b;; i++, j--) {
    if (i > n) i = 1;
    if (j < 1) j = n;
    if (i == j) yes = 1;
    if (i == x || j == y) break;
  }
  if (yes)
    puts("YES");
  else
    puts("NO");
}
