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