#include <bits/stdc++.h>
char s[2][100];
int x[2];
int main() {
  scanf("%s %s", s[0], s[1]);
  for (int i = 0; i < 2; i++) {
    if (s[i][0] == 'm') x[i] = 1;
    if (s[i][0] == 't' && s[i][1] == 'u') x[i] = 2;
    if (s[i][0] == 'w') x[i] = 3;
    if (s[i][0] == 't' && s[i][1] == 'h') x[i] = 4;
    if (s[i][0] == 'f') x[i] = 5;
    if (s[i][0] == 's' && s[i][1] == 'a') x[i] = 6;
    if (s[i][0] == 's' && s[i][1] == 'u') x[i] = 0;
  }
  if ((x[0] + 31) % 7 == x[1]) {
    puts("YES");
    return 0;
  }
  if ((x[0] + 30) % 7 == x[1]) {
    puts("YES");
    return 0;
  }
  if ((x[0] + 28) % 7 == x[1]) {
    puts("YES");
    return 0;
  }
  puts("NO");
  return 0;
}
