#include <bits/stdc++.h>
using namespace std;
int get_num(string s) {
  if (s == "monday") return 1;
  if (s == "sunday") return 0;
  if (s == "tuesday") return 2;
  if (s == "wednesday") return 3;
  if (s == "thursday") return 4;
  if (s == "friday") return 5;
  return 6;
}
int main() {
  string s1, s2;
  cin >> s1 >> s2;
  int x = get_num(s1), y = get_num(s2);
  if ((x + 31) % 7 == y || (x + 30) % 7 == y || (x + 28) % 7 == y)
    cout << "YES";
  else
    cout << "NO";
}
