#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int f[N], g[N];
vector<int> pos[30];
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  string os, ot;
  cin >> os >> ot;
  string s = " " + os, t = " " + ot;
  int n = s.size(), m = t.size();
  for (int i = 1; i < m; ++i) pos[t[i] - 'a'].push_back(i - 1);
  int flag = 1;
  for (int i = 1, mx = 0; i < n; ++i) {
    int temp = s[i] - 'a';
    if (!pos[temp].size()) {
      flag = 0;
      break;
    }
    int p =
        upper_bound(pos[temp].begin(), pos[temp].end(), mx) - pos[temp].begin();
    if (p == 0)
      f[i] = 0;
    else {
      --p;
      f[i] = pos[temp][p] + 1;
    }
    mx = max(mx, f[i]);
  }
  reverse(os.begin(), os.end()), reverse(ot.begin(), ot.end());
  s = " " + os, t = " " + ot;
  for (int i = 1; i < n; ++i) {
    if (g[i - 1] == m || s[i] != t[g[i - 1] + 1])
      g[i] = g[i - 1];
    else
      g[i] = g[i - 1] + 1;
  }
  for (int i = 1; i < n; ++i) {
    if (f[i] + g[n - i] < m) flag = 0;
  }
  if (flag)
    cout << "Yes";
  else
    cout << "No";
  return 0;
}
