#include <bits/stdc++.h>
using namespace std;
int n, a, x, b, y;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> a >> x >> b >> y;
  while (1) {
    if (a == b) {
      cout << "YES";
      return 0;
    }
    if (a == x || b == y) {
      cout << "NO";
      return 0;
    }
    a++;
    b--;
    if (a > n) a = 1;
    if (b < 1) b = n;
  }
}
