#include <bits/stdc++.h>
using namespace std;
const int N = 300005;
int n, d1, d2;
pair<int, int> s[N], t[N], a[N], b[N];
vector<pair<pair<int, int>, int> > ans;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> s[i].first, s[i].second = i;
  for (int i = 1; i <= n; i++) cin >> t[i].first, t[i].second = i;
  sort(s + 1, s + n + 1);
  sort(t + 1, t + n + 1);
  long long tong = 0;
  for (int i = 1; i <= n; i++) {
    int d = t[i].first - s[i].first;
    tong += d;
    if (tong < 0) {
      cout << "NO";
      return 0;
    }
    if (d > 0) a[++d1] = {s[i].second, d};
    if (d < 0) b[++d2] = {s[i].second, -d};
  }
  if (tong != 0) {
    cout << "NO";
    return 0;
  }
  int i = 1, j = 1;
  while (i <= d1 || j <= d2) {
    int h = min(a[i].second, b[j].second);
    ans.push_back({{a[i].first, b[j].first}, h});
    a[i].second -= h;
    b[j].second -= h;
    if (a[i].second == 0) i++;
    if (b[j].second == 0) j++;
  }
  cout << "YES\n";
  cout << ans.size() << "\n";
  for (int i = 0; i < ans.size(); i++)
    cout << ans[i].first.first << " " << ans[i].first.second << " "
         << ans[i].second << "\n";
}
