#include <bits/stdc++.h>
using namespace std;
string s1, s2;
string s[14] = {"monday",   "tuesday", "wednesday", "thursday", "friday",
                "saturday", "sunday",  "monday",    "tuesday",  "wednesday",
                "thursday", "friday",  "saturday",  "sunday"};
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> s1 >> s2;
  if (s1 == s2) {
    cout << "YES";
    return 0;
  }
  int t;
  for (int i = 0; i < 14; i++)
    if (s[i] == s1) {
      t = i;
      break;
    }
  int d = t + 2;
  if (s[d] == s2) {
    cout << "YES";
    return 0;
  }
  d++;
  if (s[d] == s2) {
    cout << "YES";
    return 0;
  }
  cout << "NO";
}
