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