#include <bits/stdc++.h>
using namespace std;
char s[200010], t[200010];
int main() {
  while (cin >> s >> t) {
    int ls = strlen(s);
    int lt = strlen(t);
    int d[30];
    memset(d, -1, sizeof(d));
    int c1 = 0, c2 = 0;
    for (int i = 0; i < ls; i++) {
      if (s[i] == t[c1]) {
        c1++;
        d[s[i] - 'a'] = c1;
      }
      if (s[i] == t[c2]) c2++;
      if (d[s[i] - 'a'] < c2) c2 = d[s[i] - 'a'];
      if (c2 < 0) break;
    }
    if (c2 < lt)
      puts("No");
    else
      puts("Yes");
  }
  return 0;
}
