#include <bits/stdc++.h>
using namespace std;
const int maxn = 200200;
int mth[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int gao(char *ch) {
  if (strcmp(ch, "monday") == 0) return 0;
  if (strcmp(ch, "tuesday") == 0) return 1;
  if (strcmp(ch, "wednesday") == 0) return 2;
  if (strcmp(ch, "thursday") == 0) return 3;
  if (strcmp(ch, "friday") == 0) return 4;
  if (strcmp(ch, "saturday") == 0) return 5;
  if (strcmp(ch, "sunday") == 0) return 6;
}
int main() {
  char ch1[22], ch2[22];
  while (scanf("%s%s", ch1, ch2) != EOF) {
    int a1 = gao(ch1), a2 = gao(ch2);
    int flag = 0;
    for (int i = 0; i < 11; i++) {
      int tmp = a1;
      for (int j = 0; j < mth[i]; j++) tmp = (tmp + 1) % 7;
      if (tmp == a2) flag = 1;
    }
    puts(flag ? "YES" : "NO");
  }
  return 0;
}
