#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const long double EPS = 1e-8;
const long double PI = acos(-1.0L);
const int MAXN = 1e5;
int main() {
  map<string, int> numd = {{"monday", 0},   {"tuesday", 1}, {"wednesday", 2},
                           {"thursday", 3}, {"friday", 4},  {"saturday", 5},
                           {"sunday", 6}};
  string s, t;
  cin >> s >> t;
  int ss = numd[s];
  int tt = numd[t];
  vector<int> m = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  for (int i = int(0); i < int(m.size()); ++i) {
    m[i] %= 7;
  }
  int dt = (tt - ss + 7) % 7;
  for (auto d : m) {
    if (dt == d) {
      printf("YES\n");
      return 0;
    }
  }
  printf("NO\n");
  return 0;
}
