#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int t[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
string d[7] = {"monday", "tuesday",  "wednesday", "thursday",
               "friday", "saturday", "sunday"};
string s1, s2;
int num(string a) {
  for (int i = 0; i < 7; i++)
    if (a == d[i]) return i;
}
int main() {
  cin >> s1 >> s2;
  for (int i = 0; i < 11; i++)
    if ((num(s2) - num(s1) + 7) % 7 == t[i] % 7) {
      puts("YES");
      return 0;
    }
  puts("NO");
  return 0;
}
