#include <bits/stdc++.h>
using namespace std;
long int getstationA(long int a, long int n) {
  if (a == n) {
    return 1;
  } else {
    return a + 1;
  }
}
long int getstationB(long int b, long int n) {
  if (b == 1) {
    return n;
  } else {
    return b - 1;
  }
}
int main() {
  long int n, a, x, b, y;
  cin >> n >> a >> x >> b >> y;
  int flag = 0;
  while (true) {
    if (a == b) {
      cout << "YES";
      flag = 1;
      break;
    }
    if (a != x && b != y) {
      a = getstationA(a, n);
      b = getstationB(b, n);
    } else if ((a == x && b == x) || (b == y && a == y)) {
      cout << "YES";
      flag = 1;
      break;
    } else {
      break;
    }
  }
  if (flag == 0) {
    cout << "NO";
  }
  return 0;
}
