#include <bits/stdc++.h>
int IntMaxVal = (int)1e20;
int IntMinVal = (int)-1e20;
long long LongMaxVal = (long long)1e20;
long long LongMinVal = (long long)-1e20;
using namespace std;
template <typename T>
struct argument_type;
template <typename T, typename U>
struct argument_type<T(U)> {};
template <typename T1, typename T2>
istream& operator>>(istream& is, pair<T1, T2>& s) {
  is >> s.first >> s.second;
  return is;
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  for (int i = 0; i < v.size(); i++) os << v[i] << ' ';
  os << endl;
  return os;
}
int main() {
  srand(time(NULL));
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  ;
  string t;
  cin >> t;
  ;
  int n = s.length();
  int m = t.length();
  vector<int> before(n);
  for (int i = 1; i < n; ++i) {
    before[i] = before[i - 1];
    if (before[i] < m && s[i - 1] == t[before[i]]) before[i]++;
  }
  vector<int> after(n);
  for (int i = n - 1; i >= 0; --i) {
    if (i < n - 1) after[i] = after[i + 1];
    if (after[i] < m && s[i] == t[m - 1 - after[i]]) after[i]++;
  }
  int charPointer[m][200];
  for (char c = 'a'; c <= 'z'; c++) charPointer[m - 1][c] = -1;
  charPointer[m - 1][t.back()] = m - 1;
  for (int i = m - 2; i >= 0; --i) {
    for (char c = 'a'; c <= 'z'; c++) charPointer[i][c] = charPointer[i + 1][c];
    charPointer[i][t[i]] = i;
  }
  for (int i = 0; i < n; ++i) {
    if (after[i] == 0) {
      cout << "No";
      return 0;
    }
    int mn = m - after[i];
    mn = charPointer[mn][s[i]];
    if (mn == -1) {
      cout << "No";
      return 0;
    }
    if (before[i] < mn) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
}
