#include <bits/stdc++.h>
using namespace std;
int cnt[26][200005];
vector<int> first, last;
string a, b;
int main(int ac, char **av) {
  cin >> a >> b;
  int j = 0;
  for (int i = 0; i < a.size() && j < b.size(); ++i)
    if (a[i] == b[j]) {
      first.push_back(i);
      ++j;
    }
  if (j != b.size()) {
    cout << "No" << endl;
    return 0;
  }
  j = b.size() - 1;
  for (int i = a.size(); i-- && j >= 0;)
    if (a[i] == b[j]) {
      last.push_back(i);
      --j;
    }
  if (j != -1) {
    cout << "No" << endl;
    return 0;
  }
  reverse(last.begin(), last.end());
  for (int i = 0; i < first.size(); ++i) {
    char c = b[i] - 'a';
    ++cnt[c][first[i]];
    --cnt[c][last[i] + 1];
  }
  for (int i = 0; i < 26; ++i)
    for (int j = 0; j < a.size(); ++j) cnt[i][j] += (j ? cnt[i][j - 1] : 0);
  for (int i = 0; i < a.size(); ++i)
    if (!cnt[a[i] - 'a'][i]) {
      cout << "No" << endl;
      return 0;
    }
  cout << "Yes" << endl;
  return 0;
}
