#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, a, b, x, y;
  cin >> n >> a >> x >> b >> y;
  a = a - 1;
  b = b - 1;
  x = x - 1;
  y = y - 1;
  bool t = 0;
  while (a != x && b != y) {
    a = (a + 1) % n;
    b = (b - 1 + n) % n;
    if (a == b) {
      t = 1;
      break;
    }
  }
  if (t)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
