#include <bits/stdc++.h>
using namespace std;
int str(string s) {
  if (s == "monday") return 1;
  if (s == "tuesday") return 2;
  if (s == "wednesday") return 3;
  if (s == "thursday") return 4;
  if (s == "friday") return 5;
  if (s == "saturday") return 6;
  if (s == "sunday") return 7;
  return 0;
}
int main() {
  string s1, s2;
  getline(cin, s1);
  getline(cin, s2);
  int a = str(s1), b = str(s2);
  int k = (7 + (b - a)) % 7;
  if (k == 0 || k == 3 || k == 2)
    printf("Yes");
  else
    printf("No");
}
