#include <bits/stdc++.h>
using namespace std;
struct IoSetup {
  IoSetup() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    cerr << fixed << setprecision(15);
  }
} iosetup;
int gcd(int a, int b) {
  if (a > b) swap(a, b);
  return a == 0 ? b : gcd(b % a, a);
}
long long gcd(long long a, long long b) {
  if (a > b) swap(a, b);
  return a == 0 ? b : gcd(b % a, a);
}
int lcm(int a, int b) { return (a / gcd(a, b)) * b; }
long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; }
inline int pow(int a, int b) {
  int ans = 1;
  for (int((i)) = ((int)0); ((i)) < ((int)((int)b)); ((i))++) ans *= a;
  return ans;
}
inline long long pow(long long a, long long b) {
  long long ans = 1;
  for (int((i)) = ((int)0); ((i)) < ((int)((int)b)); ((i))++) ans *= a;
  return ans;
}
inline long long pow(int a, long long b) {
  long long ans = 1;
  for (int((i)) = ((int)0); ((i)) < ((int)((int)b)); ((i))++) ans *= a;
  return ans;
}
inline long long pow(long long a, int b) {
  long long ans = 1;
  for (int((i)) = ((int)0); ((i)) < ((int)((int)b)); ((i))++) ans *= a;
  return ans;
}
template <typename T, typename U>
inline bool amin(T &x, U y) {
  return (y < x) ? (x = y, true) : false;
}
template <typename T, typename U>
inline bool amax(T &x, U y) {
  return (x < y) ? (x = y, true) : false;
}
template <typename C>
inline void _cin(C &c) {
  cin >> c;
}
template <typename T, typename U>
inline void _cin(pair<T, U> &p) {
  cin >> p.first;
  cin >> p.second;
}
template <typename C>
inline void _cout(const C &c) {
  cout << c;
}
template <typename T, typename U>
inline void _cout(const pair<T, U> &p) {
  cout << p.first << ' ' << p.second;
}
void in() {}
template <typename T, class... U>
void in(T &t, U &...u) {
  _cin(t);
  in(u...);
}
void out() { cout << endl; }
template <typename T, class... U>
void out(const T &t, U... u) {
  _cout(t);
  if (sizeof...(u)) cout << ' ';
  out(u...);
}
template <typename C>
inline void in(vector<C> &v, int N = -1) {
  if (((int)(v).size()) != 0) {
    int M = (N == -1) ? ((int)(v).size()) : N;
    for (int((i)) = ((int)0); ((i)) < ((int)((int)M)); ((i))++) _cin(v[i]);
  } else {
    C c;
    for (int((i)) = ((int)0); ((i)) < ((int)((int)N)); ((i))++)
      v.push_back((_cin(c), c));
  }
}
template <typename C>
inline void in(C v[], int N) {
  for (int((i)) = ((int)0); ((i)) < ((int)((int)N)); ((i))++) _cin(v[i]);
}
template <typename C>
inline void out(const vector<C> &v, int N = -1) {
  int M = (N == -1) ? ((int)(v).size()) : N;
  for (int((i)) = ((int)0); ((i)) < ((int)((int)M)); ((i))++) {
    cout << ((i) ? " " : "");
    _cout(v[i]);
  }
  cout << endl;
}
template <typename C>
inline void out(C v[], int N) {
  for (int((i)) = ((int)0); ((i)) < ((int)((int)N)); ((i))++) {
    cout << ((i) ? " " : "");
    _cout(v[i]);
  }
  cout << endl;
}
template <typename C>
inline void vector_debug(const vector<C> &v, int N = -1) {
  cout << "{";
  int M = (N == -1) ? ((int)(v).size()) : N;
  for (int((i)) = ((int)0); ((i)) < ((int)((int)M)); ((i))++) {
    cout << ((i) ? ", " : "");
    _cout(v[i]);
  }
  cout << "}";
}
template <typename C>
inline void vector_debug(C v[], int N) {
  cout << "{";
  for (int((i)) = ((int)0); ((i)) < ((int)((int)N)); ((i))++) {
    cout << ((i) ? ", " : "");
    _cout(*(v + i));
  }
  cout << "}\n";
}
void dbg_out() { cout << endl; }
template <typename T, class... U>
void dbg_out(const T &t, U... u) {
  _cout(t);
  if (sizeof...(u)) cout << ", ";
  dbg_out(u...);
}
template <typename C, class... U>
void dbg_out(const vector<C> &v, U... u) {
  vector_debug(v);
  if (sizeof...(u)) cout << ", ";
  dbg_out(u...);
}
template <typename C, class... U>
void dbg_out(const vector<vector<C>> &v, U... u) {
  cout << "{ ";
  for (int((i)) = ((int)0); ((i)) < ((int)((int)((int)(v).size()))); ((i))++) {
    if (i) cout << ", ";
    vector_debug(v[i]);
  }
  cout << " }";
  if (sizeof...(u)) cout << ", ";
  dbg_out(u...);
}
template <typename C>
inline C vmax(const vector<C> &v) {
  C n = v[0];
  for (int((i)) = ((int)0); ((i)) < ((int)((int)((int)(v).size()))); ((i))++)
    amax(n, v[i]);
  return n;
}
template <typename C>
inline C vmax(C v[], int N) {
  C n = v[0];
  for (int((i)) = ((int)0); ((i)) < ((int)((int)N)); ((i))++) amax(n, v[i]);
  return n;
}
template <typename C>
inline C vmin(const vector<C> &v) {
  C n = v[0];
  for (int((i)) = ((int)0); ((i)) < ((int)((int)((int)(v).size()))); ((i))++)
    amin(n, v[i]);
  return n;
}
template <typename C>
inline C vmin(C v[], int N) {
  C n = v[0];
  for (int((i)) = ((int)0); ((i)) < ((int)((int)N)); ((i))++) amin(n, v[i]);
  return n;
}
template <typename C>
inline C vsum(const vector<C> &v) {
  C n = 0;
  for (int((i)) = ((int)0); ((i)) < ((int)((int)((int)(v).size()))); ((i))++)
    n += v[i];
  return n;
}
template <typename C>
inline C vsum(C v[], int N) {
  C n = 0;
  for (int((i)) = ((int)0); ((i)) < ((int)((int)N)); ((i))++) n += v[i];
  return n;
}
int main() {
  int N, a, b, c, d;
  in(N, a, b, c, d);
  1;
  while (a != b && c != d) {
    a = (a == N ? 1 : a + 1);
    c = (c == 1 ? N : --c);
    1;
    if (a == c) {
      out("YES");
      return 0;
    }
  }
  out("NO");
}
