#include <bits/stdc++.h>
template <class T>
inline void chkmax(T &x, const T &y) {
  if (x < y) x = y;
}
template <class T>
inline void chkmin(T &x, const T &y) {
  if (x > y) x = y;
}
template <class T>
inline void read(T &x) {
  char c;
  int f = 1;
  x = 0;
  while (((c = getchar()) < '0' || c > '9') && c != '-')
    ;
  if (c == '-')
    f = -1;
  else
    x = c - '0';
  while ((c = getchar()) >= '0' && c <= '9') x = x * 10 + c - '0';
  x *= f;
}
static int outn;
static char out[(int)2e7];
template <class T>
inline void write(T x) {
  if (x < 0) out[outn++] = '-', x = -x;
  if (x) {
    static int tmpn;
    static char tmp[20];
    tmpn = 0;
    while (x) tmp[tmpn++] = x % 10 + '0', x /= 10;
    while (tmpn) out[outn++] = tmp[--tmpn];
  } else
    out[outn++] = '0';
}
std::map<std::string, int> s;
int main() {
  s["monday"] = 0, s["tuesday"] = 1, s["wednesday"] = 2, s["thursday"] = 3,
  s["friday"] = 4, s["saturday"] = 5, s["sunday"] = 6;
  std::string a, b;
  std::cin >> a >> b;
  int x = (s[b] - s[a] + 7) % 7;
  if (x == 31 % 7 || x == 30 % 7 || x == 28 % 7)
    puts("YES");
  else
    puts("NO");
  return 0;
}
