#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 20, K = 19;
const int mod = 1e9 + 7;
int main() {
  int n, a, b, x, y;
  cin >> n >> a >> x >> b >> y;
  a--, x--, b--, y--;
  int fs = a;
  int sc = b;
  while (1) {
    if (fs == sc) return puts("YES"), 0;
    if (fs == x) return puts("NO"), 0;
    if (sc == y) return puts("NO");
    fs = (fs + 1) % n;
    sc = (sc - 1 + n) % n;
  }
  return 0;
}
