#include <bits/stdc++.h>
using namespace std;
int get() {
  string s;
  cin >> 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 0;
}
int main() {
  int x = get();
  int y = get();
  int months[] = {31, 28, 30};
  for (int i = 0; i <= 6; i++) {
    for (int j = 0; j < 3; j++) {
      if (x == i && (x + months[j]) % 7 == y) {
        printf("YES\n");
        return 0;
      }
    }
  }
  printf("NO\n");
  return 0;
}
