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