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