#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:64000000")
const int infi = 1e9 + 7;
const long long infl = 1e18;
const double eps = 1e-7;
const int MAX_MEM = 1e8;
int mpos = 0;
char mem[MAX_MEM];
inline void *operator new(size_t n) {
  char *res = mem + mpos;
  mpos += n;
  assert(mpos <= MAX_MEM);
  return (void *)res;
}
inline void operator delete(void *) {}
inline void *operator new[](size_t) { assert(0); }
inline void operator delete[](void *) { assert(0); }
int ar[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
string arz[] = {"monday", "tuesday",  "wednesday", "thursday",
                "friday", "saturday", "sunday"};
int main() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  string a, b;
  cin >> a >> b;
  int q, w;
  for (int i = 0; i < 7; ++i)
    if (a == arz[i]) q = i;
  for (int i = 0; i < 7; ++i)
    if (b == arz[i]) w = i;
  for (int st = 0; st < 7; ++st) {
    int cur = st, next = (st + 31) % 7;
    for (int i = 0; i < 11; ++i) {
      if (cur == q && w == next) {
        cout << "YES";
        return 0;
      }
      cur += ar[i];
      cur %= 7;
      next += ar[i + 1];
      next %= 7;
    }
  }
  cout << "NO";
  return 0;
}
