#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
string a, b;
deque<int> lst[27], fst[27];
int arr[27][N] = {};
vector<int> vv[27];
int main() {
  ios::sync_with_stdio(0), ios_base::sync_with_stdio(0), cin.tie(0),
      cout.tie(0);
  ;
  cin >> a >> b;
  if (a.size() < b.size())
    return cout << "No"
                << "\n",
           0;
  for (int i = 0; i <= (int)a.size() - 1; ++i) vv[a[i] - 'a'].push_back(i + 1);
  int j = 0;
  for (int i = 0; i <= (int)a.size() - 1; ++i) {
    if (a[i] == b[j]) {
      fst[b[j] - 'a'].push_back(i + 1);
      j++;
      if (j == b.size()) break;
    }
  }
  if (j != b.size())
    return cout << "No"
                << "\n",
           0;
  j = b.size() - 1;
  for (int i = (int)a.size() - 1; i >= 0; --i) {
    if (a[i] == b[j]) {
      lst[b[j] - 'a'].push_front(i + 1);
      j--;
      if (j == -1) break;
    }
  }
  if (j != -1)
    return cout << "No"
                << "\n",
           0;
  for (int i = 0; i <= 25; ++i) {
    for (int k = 0; k <= (int)fst[i].size() - 1; ++k) {
      arr[i][fst[i][k]]++;
      arr[i][lst[i][k] + 1]--;
    }
    for (int j = 1; j <= (int)a.size(); ++j) arr[i][j] += arr[i][j - 1];
    for (auto u : vv[i])
      if (!arr[i][u])
        return cout << "No"
                    << "\n",
               0;
  }
  return cout << "Yes"
              << "\n",
         0;
  return 0;
}
