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