#include <bits/stdc++.h>
using namespace std;
map<string, int> mp = {{"monday", 0},   {"tuesday", 1}, {"wednesday", 2},
                       {"thursday", 3}, {"friday", 4},  {"saturday", 5},
                       {"sunday", 6}};
int t[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string a, b;
  cin >> a >> b;
  int x = mp[a], y = mp[b];
  for (int i = 0; i < 11; i++) {
    if ((x + t[i]) % 7 == y) {
      puts("YES");
      return 0;
    }
  }
  puts("NO");
  return 0;
}
