#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5;
vector<pair<pair<int, int>, int>> vec;
pair<int, int> a[N], b[N];
set<int> s, t;
int n;
inline void add(int i, int j, int d) {
  vec.push_back({{a[i].second, a[j].second}, d});
  a[i].first += d, a[j].first -= d;
  if (a[i].first == b[i].first) s.erase(i);
  if (a[j].first == b[j].first) t.erase(j);
}
inline void read_input() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i].first;
    b[i].second = i;
  }
}
inline void solve() {
  sort(a, a + n);
  sort(b, b + n);
  for (int i = 0; i < n; i++) {
    if (a[i].first < b[i].first) s.insert(i);
    if (a[i].first > b[i].first) t.insert(i);
  }
  while (!s.empty() && !t.empty()) {
    int i = *s.begin(), j = *t.begin();
    if (i > j) break;
    add(i, j, min(b[i].first - a[i].first, a[j].first - b[j].first));
  }
}
inline void write_output() {
  if (!s.empty() || !t.empty()) {
    cout << "NO";
    return;
  }
  cout << "YES\n" << vec.size() << endl;
  for (auto x : vec) {
    cout << ++x.first.first << ' ' << ++x.first.second;
    cout << ' ' << x.second << endl;
  }
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  read_input(), solve(), write_output();
  return 0;
}
