#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, a, x, b, y;
  cin >> n >> a >> x >> b >> y;
  long long int c[300];
  long long int d[300];
  long long int e = 0, f = 0;
  long long int t = 0;
  for (long long int i = 0; i < 2 * n; i++) {
    c[e] = a;
    if (a == x) {
      e++;
      break;
    }
    if (a == n) {
      a = 0;
    }
    a++;
    e++;
  }
  for (long long int i = 2 * n; i >= 0; i--) {
    d[f] = b;
    if (b == y) {
      f++;
      break;
    }
    if (b == 1) {
      b = n + 1;
    }
    f++;
    b--;
  }
  for (long long int i = 0; i < min(e, f); i++) {
    if (c[i] == d[i]) {
      t = 1;
      break;
    }
  }
  if (t == 1) {
    cout << "YES";
  } else {
    cout << "NO";
  }
}
