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