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