#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long llinf = 0x3f3f3f3f3f3f3f3f;
template <typename INint>
inline void IN(INint &first) {
  first = 0;
  int f = 1;
  char c;
  cin.get(c);
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    cin.get(c);
  }
  while (c >= '0' && c <= '9') {
    first = first * 10 + c - '0';
    cin.get(c);
  }
  first *= f;
}
template <typename INint>
inline void OUT(INint first) {
  if (first > 9) OUT(first / 10);
  cout.put(first % 10 + '0');
}
const int maxn = int(20);
int main() {
  int T(1), times(0);
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  while (++times, T--) {
    int n, a, first, b, second;
    cin >> n >> a >> first >> b >> second;
    int t = 110;
    while (t--) {
      if (a == b) {
        cout << "YES" << endl;
        return 0;
      }
      if (a > 0) {
        ++a;
        if (a > n) a = 1;
      }
      if (b > 0) {
        --b;
        if (b < 1) b = n;
      }
      if (a == b) {
        cout << "YES" << endl;
        return 0;
      }
      if (a == first) a = -first;
      if (b == second) b = -second;
    }
    cout << "NO" << endl;
  }
  return 0;
}
