#include <bits/stdc++.h>
using namespace std;
int n;
vector<pair<long long, int>> s;
int t[300001];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  long long x;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    s.push_back(make_pair(x, i));
  }
  for (int i = 0; i < n; i++) {
    cin >> t[i];
  }
  sort(s.begin(), s.end());
  sort(t, t + n);
  int sum = 0;
  for (int i = 0; i < n; i++) {
    sum += t[i] - s[i].first;
  }
  if (sum) {
    cout << "NO\n";
    return 0;
  }
  ostringstream ss;
  int count = 0;
  int fail = 0;
  int j = 1;
  for (int i = 0; i < n; i++) {
    auto& left = s[i];
    auto& left_target = t[i];
    if (left.first == left_target) continue;
    if (left.first > left_target) {
      fail = 1;
      break;
    }
    if (j <= i) j = i + 1;
    for (; j < n; j++) {
      auto& right = s[j];
      auto& right_target = t[j];
      if (right.first <= right_target) continue;
      int a = t[i] - left.first;
      int b = right.first - right_target;
      int d = min(a, b);
      left.first += d;
      right.first -= d;
      ss << left.second << ' ' << right.second << ' ' << d << '\n';
      count++;
      if (left.first == left_target) break;
    }
  }
  if (fail) {
    cout << "NO\n";
    return 0;
  }
  cout << "YES\n";
  cout << count << '\n';
  cout << ss.str();
  return 0;
}
