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