#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, c, d;
  cin >> n >> a >> b >> c >> d;
  int y1 = a;
  int y2 = c;
  int flag = 0;
  while (y1 != b && y2 != d) {
    y1++;
    y2--;
    if (y1 > n) {
      y1 -= n;
    }
    if (y2 < 1) {
      y2 += n;
    }
    if (y1 == y2) {
      flag = 1;
      break;
    }
  }
  if (y1 == y2) {
    flag = 1;
  }
  if (flag) {
    printf("YES\n");
  } else {
    printf("NO\n");
  }
  return 0;
}
