#include <bits/stdc++.h>
using namespace std;
void boost() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
int main() {
  boost();
  int n, a, b, x, y;
  cin >> n >> a >> x >> b >> y;
  int i;
  int fl = 1;
  int ans = -1;
  while (fl) {
    if (a == b) {
      ans = 0;
      break;
    }
    if (a == x || b == y) {
      ans = 1;
      break;
    }
    a++;
    if (a == n + 1) a = 1;
    b--;
    if (b == 0) b = n;
  }
  if (ans == 0) {
    cout << "YES";
  } else
    cout << "NO";
}
