#include <bits/stdc++.h>
using namespace std;
int a[29] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int main() {
  string x1, x2;
  cin >> x1 >> x2;
  int xx1, xx2;
  if (x1[0] == 'm')
    xx1 = 1;
  else if (x1[0] == 't' && x1[1] == 'u')
    xx1 = 2;
  else if (x1[0] == 'w')
    xx1 = 3;
  else if (x1[0] == 't')
    xx1 = 4;
  else if (x1[0] == 'f')
    xx1 = 5;
  else if (x1[0] == 's' && x1[1] == 'a')
    xx1 = 6;
  else
    xx1 = 7;
  if (x2[0] == 'm')
    xx2 = 1;
  else if (x2[0] == 't' && x2[1] == 'u')
    xx2 = 2;
  else if (x2[0] == 'w')
    xx2 = 3;
  else if (x2[0] == 't')
    xx2 = 4;
  else if (x2[0] == 'f')
    xx2 = 5;
  else if (x2[0] == 's' && x2[1] == 'a')
    xx2 = 6;
  else
    xx2 = 7;
  int i, j;
  for (i = 1; i <= 11; i++) {
    int d = xx1;
    for (j = 1; j <= a[i]; j++) d = d % 7 + 1;
    if (d == xx2) {
      printf("YES\n");
      return 0;
    }
  }
  printf("NO\n");
  return 0;
}
