#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const int INF = 0x3f3f3f3f;
const long long INFF = 0x3f3f;
const double pi = acos(-1.0);
const double inf = 1e18;
const double eps = 1e-6;
const long long mod = 1e9 + 7;
const unsigned long long mx = 133333331;
inline void RI(int& x) {
  char c;
  while ((c = getchar()) < '0' || c > '9')
    ;
  x = c - '0';
  while ((c = getchar()) >= '0' && c <= '9') x = (x << 3) + (x << 1) + c - '0';
}
int cal(char* str) {
  if (str[0] == 'm')
    return 1;
  else if (str[0] == 't') {
    for (int i = 0; i < 5; i++) {
      int j = 0;
      j++;
    }
    if (str[1] == 'u')
      return 2;
    else
      return 4;
  } else if (str[0] == 'w')
    return 3;
  else if (str[0] == 'f')
    return 5;
  else if (str[1] == 'a')
    return 6;
  else
    return 0;
}
char a[35], b[35];
int main() {
  scanf("%s%s", a, b);
  for (int i = 0; i < 5; i++) {
    int j = 0;
    j++;
  }
  int aa = cal(a);
  int bb = cal(b);
  for (int i = 0; i < 5; i++) {
    int j = 0;
    j++;
  }
  if (aa == bb || (aa + 2) % 7 == bb || (aa + 3) % 7 == bb)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
