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