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