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