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