#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2;
  int a1, a2;
  int d[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  while (cin >> s1) {
    int mark = 0;
    cin >> s2;
    if (s1 == "monday") a1 = 1;
    if (s1 == "tuesday") a1 = 2;
    if (s1 == "wednesday") a1 = 3;
    if (s1 == "thursday") a1 = 4;
    if (s1 == "friday") a1 = 5;
    if (s1 == "saturday") a1 = 6;
    if (s1 == "sunday") a1 = 0;
    if (s2 == "monday") a2 = 1;
    if (s2 == "tuesday") a2 = 2;
    if (s2 == "wednesday") a2 = 3;
    if (s2 == "thursday") a2 = 4;
    if (s2 == "friday") a2 = 5;
    if (s2 == "saturday") a2 = 6;
    if (s2 == "sunday") a2 = 0;
    for (int i = 0; i < 12; i++) {
      if ((a1 + d[i]) % 7 == a2) {
        mark = 1;
        break;
      }
    }
    if (mark) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  }
  return 0;
}
