#include <bits/stdc++.h>
using namespace std;
vector<string> split(const string& s, char c) {
  vector<string> v;
  stringstream ss(s);
  string x;
  while (getline(ss, x, c)) v.emplace_back(x);
  return move(v);
}
void err(vector<string>::iterator it) {}
template <typename T, typename... Args>
void err(vector<string>::iterator it, T a, Args... args) {
  cerr << it->substr((*it)[0] == ' ', it->length()) << " = " << a << '\n';
  err(++it, args...);
}
const int maxn = (int)1e5 + 5, mod = (int)1e9 + 7;
int main(int argc, char const* argv[]) {
  string days[] = {"monday", "tuesday",  "wednesday", "thursday",
                   "friday", "saturday", "sunday"};
  int months[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  string s1, s2;
  cin >> s1 >> s2;
  int i, j, k, ind, m, n, t;
  for (ind = 0; ind < 7; ind++) {
    if (days[ind] == s1) break;
  }
  for (i = 0; i < 11; i++) {
    if (days[(ind + months[i]) % 7] == s2) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
