#include <bits/stdc++.h>
using namespace std;
struct qq {
  int l, r, d;
};
int n, x;
pair<int, int> s[300015];
int t[300015], need[300015];
vector<qq> v;
void input() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  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];
  }
  sort(t + 1, t + 1 + n);
  sort(s + 1, s + 1 + n);
}
int main() {
  input();
  int l = 1;
  for (int i = 1; i <= n; i++) {
    if (s[i].first <= t[i])
      need[i] = t[i] - s[i].first;
    else {
      int temp = s[i].first - t[i];
      while (temp) {
        while (l < i && need[l] == 0) l++;
        if (l == i) break;
        int minx = min(temp, need[l]);
        temp -= minx;
        need[l] -= minx;
        v.push_back({s[l].second, s[i].second, minx});
      }
      if (temp) {
        cout << "NO";
        return 0;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (need[i]) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES\n" << v.size() << "\n";
  for (qq i : v) {
    cout << i.l << " " << i.r << " " << i.d << "\n";
  }
  return 0;
}
