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