#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
int l[300];
int main() {
  string s, t;
  cin >> s >> t;
  int cnt = 0;
  int cnt2 = 0;
  memset(l, -1, sizeof(l));
  for (int i = 0; i < s.size() && cnt2 >= 0; ++i) {
    if (s[i] == t[cnt]) {
      cnt++;
      l[s[i]] = cnt;
    }
    if (s[i] == t[cnt2]) {
      cnt2++;
    }
    cnt2 = min(cnt2, l[s[i]]);
  }
  if (cnt2 < t.size())
    puts("No");
  else if (cnt2 < 0)
    puts("No");
  else
    puts("Yes");
}
