#include <bits/stdc++.h>
using namespace std;
const int N = 200000 + 5, inf = 2e9;
const long double EPS = 1e-9L;
vector<pair<int, int> > pairs[26];
vector<int> mn[26];
int leftSub[N], rightSub[N];
void computeSub(string& a, string& b, int ans[]) {
  for (int i = 0; i < (int)(a).size(); ++i) {
    int prv = 0;
    if (i != 0) prv = ans[i - 1];
    if (prv == (int)(b).size() || a[i] != b[prv])
      ans[i] = ans[i - 1];
    else
      ans[i] = 1 + ans[i - 1];
  }
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s, t;
  cin >> s >> t;
  for (int i = 0; i < (int)(t).size(); ++i) {
    int l = i, r = (int)(t).size() - 1 - i;
    pairs[t[i] - 'a'].push_back({l, r});
  }
  for (int c = 0; c < 26; ++c) {
    sort(pairs[c].begin(), pairs[c].end());
    for (int i = 0; i < (int)(pairs[c]).size(); ++i) {
      if (i == 0)
        mn[c].push_back(pairs[c][i].second);
      else
        mn[c].push_back(min(pairs[c][i].second, mn[c][i - 1]));
    }
  }
  computeSub(s, t, leftSub);
  reverse(s.begin(), s.end()), reverse(t.begin(), t.end());
  computeSub(s, t, rightSub);
  reverse(s.begin(), s.end()), reverse(rightSub, rightSub + (int)(s).size());
  for (int i = 0; i < (int)(s).size(); ++i) {
    int a = 0, b = 0;
    if (i != 0) a = leftSub[i - 1];
    if (i != (int)(s).size() - 1) b = rightSub[i + 1];
    pair<int, int> p = {a, inf};
    if (pairs[s[i] - 'a'].empty() || pairs[s[i] - 'a'][0] > p) {
      cout << "No\n";
      return 0;
    }
    int ind =
        upper_bound(pairs[s[i] - 'a'].begin(), pairs[s[i] - 'a'].end(), p) -
        begin(pairs[s[i] - 'a']);
    if (mn[s[i] - 'a'][ind - 1] > b) {
      cout << "No\n";
      return 0;
    }
  }
  cout << "Yes\n";
}
