#include <bits/stdc++.h>
using namespace std;
const int inf_int = 2e9;
const long long inf_ll = 2e18;
int Gcd(int p, int q) { return q == 0 ? p : Gcd(q, p % q); }
int Pow(int p, int q) {
  int ans = 1;
  while (q) {
    if (q & 1) ans = ans * p;
    p = p * p;
    q >>= 1;
  }
  return ans;
}
inline int read() {
  int ra, fh;
  char rx;
  rx = getchar(), ra = 0, fh = 1;
  while ((rx < '0' || rx > '9') && rx != '-') rx = getchar();
  if (rx == '-') fh = -1, rx = getchar();
  while (rx >= '0' && rx <= '9') ra *= 10, ra += rx - 48, rx = getchar();
  return ra * fh;
}
string wk[7] = {"monday", "tuesday",  "wednesday", "thursday",
                "friday", "saturday", "sunday"},
       a, b;
int p, q;
int main() {
  cin >> a >> b;
  for (int i = (0), _ed = (7); i <= _ed; i++)
    if (wk[i] == a) p = i;
  for (int i = (0), _ed = (7); i <= _ed; i++)
    if (wk[i] == b) q = i;
  if (p == q || (p + 2) % 7 == q || (p + 3) % 7 == q) {
    puts("YES");
  } else {
    puts("NO");
  }
}
