#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
inline bool EQ(double a, double b) { return fabs(a - b) < 1e-9; }
long long bigmod(long long a, long long b) {
  long long ret = 1;
  while (b) {
    if (b & 1) ret = (ret * a) % 1000000007;
    b >>= 1;
    a = (a * a) % 1000000007;
  }
  return ret;
}
long long inverse(long long n) { return bigmod(n, 1000000007 - 2); }
long long add(long long a, long long b) {
  long long ret = a + b;
  if (ret >= 1000000007) ret %= 1000000007;
  return ret;
}
long long subtract(long long a, long long b) {
  long long ret = a - b;
  if (ret < 0) ret += 1000000007;
  return ret;
}
long long mult(long long a, long long b) {
  long long ret = a * b;
  if (ret >= 1000000007) ret %= 1000000007;
  return ret;
}
bool base[1000010];
vector<int> primes;
void sieve(int mx) {
  mx += 10;
  int x = sqrt(mx);
  for (int i = 3; i <= x; i += 2)
    if (base[i] == 0)
      for (int j = i * i, k = i << 1; j < mx; j += k) base[j] = 1;
  primes.push_back(2);
  for (int i = 3; i < mx; i += 2)
    if (base[i] == 0) primes.push_back(i);
}
bool checkBit(int n, int i) { return (n & (1 << i)); }
int setBit(int n, int i) { return (n | (1 << i)); }
int resetBit(int n, int i) { return (n & (~(1 << i))); }
char a[200010], b[200010];
int dp1[200010], dp2[200010], idx[26];
int main() {
  scanf("%s", a + 1);
  scanf("%s", b + 1);
  int n = strlen(a + 1);
  int m = strlen(b + 1);
  for (int i = 0; i < 26; ++i) idx[i] = -1;
  for (int i = 1, j = 1; i <= n; ++i) {
    if (a[i] == b[j]) {
      dp1[i] = j++;
      idx[a[i] - 'a'] = i;
    } else if (idx[a[i] - 'a'] == -1) {
      cout << "No" << endl;
      return 0;
    } else
      dp1[i] = dp1[idx[a[i] - 'a']];
  }
  for (int i = 0; i < 26; ++i) idx[i] = -1;
  for (int i = n, j = m; i > 0; --i) {
    if (a[i] == b[j]) {
      assert(j >= 0);
      dp2[i] = m - j;
      idx[a[i] - 'a'] = i;
      --j;
    } else if (idx[a[i] - 'a'] == -1) {
      cout << "No" << endl;
      return 0;
    } else
      dp2[i] = dp2[idx[a[i] - 'a']];
  }
  for (int i = 1; i <= n; ++i)
    if (dp1[i] + dp2[i] < m) {
      cout << "No" << endl;
      return 0;
    }
  cout << "Yes" << endl;
  return 0;
}
