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