#include <bits/stdc++.h>
using namespace std;
char x[20], y[20];
char a[7][17] = {"monday", "tuesday",  "wednesday", "thursday",
                 "friday", "saturday", "sunday"};
int b[17] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int main() {
  int i = 0, n = 0, m = 0;
  cin >> x >> y;
  for (i = 0; i < 7; i++) {
    if (strcmp(a[i], x) == 0) {
      n = i + 1;
    }
    if (strcmp(a[i], y) == 0) {
      m = i + 1;
    }
  }
  int f = 0, t = 0, p = 0;
  for (i = 0; i < 11; i++) {
    t = b[i] % 7;
    if (n + t == 7) {
      p = n + t;
    } else {
      p = (n + t) % 7;
    }
    if (p == m) {
      cout << "YES" << endl;
      return 0;
      break;
    }
  }
  cout << "NO" << endl;
  return 0;
}
