#include <bits/stdc++.h>
using namespace std;
const int N = 201000;
char s[N], t[N];
int a[N], b[N];
vector<int> p[128];
int main() {
  scanf("%s\n", s);
  scanf("%s", t);
  int ls = strlen(s);
  int lt = strlen(t);
  if (ls < lt) {
    printf("No\n");
    return 0;
  }
  for (int i = 0; i < ls; ++i) {
    a[i + 1] = a[i];
    if (t[a[i]] == s[i]) ++a[i + 1];
  }
  for (int i = ls - 1; i >= 0; --i) {
    b[i] = b[i + 1];
    if (t[lt - b[i + 1] - 1] == s[i]) ++b[i];
  }
  for (int i = 0; i < lt; ++i) p[int(t[i])].push_back(i);
  for (int i = 0; i < ls; ++i) {
    vector<int>::iterator it =
        lower_bound(p[s[i]].begin(), p[s[i]].end(), lt - b[i + 1] - 1);
    if (it == p[s[i]].end()) {
      printf("No\n");
      return 0;
    }
    if (*it >= a[i] + 1) {
      printf("No\n");
      return 0;
    }
  }
  printf("Yes\n");
  return 0;
}
