#include <bits/stdc++.h>
using namespace std;
void bit() {
  cout << "NO" << endl;
  exit(0);
}
int main() {
  int n;
  cin >> n;
  vector<int> arr(n);
  vector<int> hedef(n);
  vector<pair<int, int> > tut(n);
  for (int i = 0; i < n; i++) cin >> arr[i];
  for (int i = 0; i < n; i++) cin >> hedef[i];
  for (int i = 0; i < n; i++) {
    tut[i] = make_pair(arr[i], i);
  }
  sort(arr.begin(), arr.end());
  sort(hedef.begin(), hedef.end());
  sort(tut.begin(), tut.end());
  int i = 0;
  int j = 1;
  vector<pair<pair<int, int>, int> > ans;
  while (j < n) {
    if (arr[j] <= hedef[j])
      j++;
    else if (arr[i] == hedef[i])
      i++;
    else if (arr[i] > hedef[i])
      bit();
    else if (i == j)
      bit();
    else {
      int ifark = hedef[i] - arr[i];
      int jfark = arr[j] - hedef[j];
      ans.push_back(make_pair(make_pair(tut[i].second, tut[j].second),
                              min(ifark, jfark)));
      arr[i] += min(ifark, jfark);
      arr[j] -= min(ifark, jfark);
    }
  }
  for (int i = 0; i < n; i++)
    if (arr[i] != hedef[i]) bit();
  cout << "YES" << endl;
  cout << ans.size() << endl;
  for (auto eleman : ans) {
    cout << eleman.first.first + 1 << ' ' << eleman.first.second + 1 << ' '
         << eleman.second << endl;
  }
}
