#include <bits/stdc++.h>
using namespace std;
char s1[100];
char s2[100];
int check(char *str) {
  if (str[0] == 's' && str[1] == 'u') return 0;
  if (str[0] == 'm' && str[1] == 'o') return 1;
  if (str[0] == 't' && str[1] == 'u') return 2;
  if (str[0] == 'w' && str[1] == 'e') return 3;
  if (str[0] == 't' && str[1] == 'h') return 4;
  if (str[0] == 'f' && str[1] == 'r') return 5;
  if (str[0] == 's' && str[1] == 'a') return 6;
}
int main() {
  scanf("%s", s1);
  scanf("%s", s2);
  int a = check(s1), b = check(s2);
  if (a == b || (a + 2) % 7 == b || (a + 3) % 7 == b)
    printf("YES\n");
  else
    printf("NO\n");
}
