#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int MOD = INF + 7;
vector<int> mday{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,
                 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
vector<string> day{"monday",   "tuesday", "wednesday", "thursday", "friday",
                   "saturday", "sunday",  "monday",    "tuesday",  "wednesday",
                   "thursday", "friday",  "saturday",  "sunday"};
int main(void) {
  string m1, m2;
  bool f = false;
  cin >> m1 >> m2;
  for (int(i) = 0; (i) < (day.size() - 1); (i)++) {
    if (m1 == day[i]) {
      for (int(j) = 0; (j) < (mday.size() - 1); (j)++) {
        if (day[(i + mday[j]) % 7] == m2) f = true;
      }
    }
  }
  string ans = "";
  if (f)
    ans = "YES";
  else
    ans = "NO";
  cout << ans << endl;
}
