#include <bits/stdc++.h>
using namespace std;
int gts(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;
}
int main() {
  string s1, s2;
  cin >> s1 >> s2;
  int k1 = gts(s1) - 1;
  int k2 = gts(s2) - 1;
  if ((k1 + 29) % 7 == k2)
    printf("NO\n");
  else if ((k1 + 30) % 7 == k2 || (k1 + 28) % 7 == k2 || (k1 + 31) % 7 == k2)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
