#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, a, b, x, y;
  cin >> n >> a >> x >> b >> y;
  vector<int> v, vec;
  while (x != a) {
    a++;
    if (a > n) {
      a = 1;
    }
    v.push_back(a);
  }
  while (y != b) {
    b--;
    if (b < 1) {
      b = n;
    }
    vec.push_back(b);
  }
  bool check = false;
  for (int i = 0; i < v.size() && i < vec.size(); i++) {
    if (v[i] == vec[i]) {
      check = true;
    }
  }
  if (check == true) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
