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