7 3
1 4 7
1 2 2
2 3 3
3 4 8
2 5 1
1 6 4
6 7 5
 10 2
1 5
5 3 2
8 4 8
7 6 9
7 10 1
10 1 4
9 5 1
5 8 2
7 2 9
6 5 6
 10 5
4 8 7 5 1
5 1 1
2 7 1
4 3 1
10 9 1
10 1 1
1 8 1
10 7 1
10 3 1
7 6 1
 10 9
9 7 6 10 3 5 2 8 1
9 4 10
10 8 3
3 6 2
5 1 8
5 2 5
1 10 10
6 7 1
9 1 7
1 6 3
 10 5
8 5 2 10 1
3 1 7
5 4 6
10 8 4
6 8 9
7 8 4
9 5 6
8 1 9
2 10 2
9 8 7

3 2
 2 3
 5 1
 0 1
 5 1

#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 100;
int n, m;
bool mark[maxn];
int tot, head[maxn], to[maxn << 1], nxt[maxn << 1], w[maxn << 1];
void add_edge(int u, int v, int c) {
  to[++tot] = v;
  nxt[tot] = head[u];
  w[tot] = c;
  head[u] = tot;
}
void add_edges(int x, int y, int w) {
  add_edge(x, y, w);
  add_edge(y, x, w);
}
int Dis[maxn], fa[maxn][17], dep[maxn];
void dfs(int f, int x) {
  dep[x] = dep[f] + 1;
  fa[x][0] = f;
  for (int i = 1; i < 17; i++) fa[x][i] = fa[fa[x][i - 1]][i - 1];
  for (int i = head[x]; i; i = nxt[i]) {
    int y = to[i];
    if (y == f) continue;
    Dis[y] = Dis[x] + w[i];
    dfs(x, y);
  }
}
void up(int &a, int k) {
  for (int i = 0; i < 17; i++)
    if (1 << i & k) a = fa[a][i];
}
int LCA(int a, int b) {
  if (dep[a] > dep[b])
    up(a, dep[a] - dep[b]);
  else
    up(b, dep[b] - dep[a]);
  if (a == b) return a;
  for (int i = 16; i >= 0; i--)
    if (fa[a][i] != fa[b][i]) a = fa[a][i], b = fa[b][i];
  return fa[a][0];
}
int solve(int a, int b) { return Dis[a] + Dis[b] - Dis[LCA(a, b)] * 2; }
int maxd, v, a, b;
void find_d(int f, int x, int d) {
  if (mark[x] && d > maxd) {
    maxd = d;
    v = x;
  }
  for (int i = head[x]; i; i = nxt[i])
    if (to[i] != f) find_d(x, to[i], d + w[i]);
}
int id, num[maxn];
bool inque[maxn];
int ans1, ans2;
void check(int x) {
  if (ans1 == x)
    ans2++;
  else if (x > ans1)
    ans1 = x, ans2 = 1;
}
bool dfs1(int f, int x) {
  bool isok = 0;
  if (x == a || x == b) isok = 1;
  for (int i = head[x]; i; i = nxt[i])
    if (to[i] != f) isok |= dfs1(x, to[i]);
  if (isok) {
    num[++id] = x;
    inque[x] = 1;
  }
  return isok;
}
int sz[maxn];
void dfs2(int f, int x) {
  sz[x] = mark[x];
  for (int i = head[x]; i; i = nxt[i]) {
    int y = to[i];
    if (y == f || inque[y]) continue;
    dfs2(x, y);
    sz[x] += sz[y];
  }
  if (mark[x] == 0 && f != 0) check(sz[x]);
}
int dis[maxn], mx[maxn];
void dfs3(int f, int x, int d) {
  if (mark[x]) mx[x] = dis[x] = d;
  for (int i = head[x]; i; i = nxt[i])
    if (to[i] != f && !inque[to[i]]) {
      dfs3(x, to[i], d + w[i]);
      mx[x] = max(mx[x], mx[to[i]]);
    }
}
void init() {
  dfs(0, 1);
  for (int i = 1; i <= n; i++)
    if (mark[i]) {
      find_d(0, i, 0);
      break;
    }
  a = v;
  maxd = 0;
  find_d(0, v, 0);
  b = v;
}
int sum[maxn];
void solve() {
  dfs1(0, b);
  for (int i = 2; i < id; i++) dfs2(0, num[i]);
  for (int i = 2; i < id; i++) dfs3(0, num[i], 0);
  int L = 1, R = id, L2 = 1, R2 = id;
  for (int i = 2; i < id; i++) {
    int x = num[i];
    if (solve(x, a) == mx[x]) {
      L2 = L;
      L = i;
    }
  }
  for (int i = id - 1; i > 1; i--) {
    int x = num[i];
    if (solve(x, b) == mx[x]) {
      R2 = R;
      R = i;
    }
  }
  sz[a] = 1;
  sz[b] = 1;
  for (int i = 1; i <= id; i++) {
    int x = num[i];
    if (solve(x, a) > solve(x, b)) {
      if (i != L) {
        sum[L] += sz[x];
        sum[i + 1] -= sz[x];
      } else {
        sum[L2] += sz[x];
        sum[i + 1] -= sz[x];
      }
    } else if (solve(x, a) < solve(x, b)) {
      if (i != R) {
        sum[i] += sz[x];
        sum[R + 1] -= sz[x];
      } else {
        sum[i] += sz[x];
        sum[R2 + 1] -= sz[x];
      }
    } else if (solve(x, a) == solve(x, b)) {
      sum[i] += sz[x];
      sum[i + 1] -= sz[x];
    }
  }
  for (int i = 1; i <= id; i++) {
    sum[i] += sum[i - 1];
    if (mark[num[i]] == 0) {
      check(sum[i]);
    }
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1, x; i <= m; i++) {
    scanf("%d", &x);
    mark[x] = 1;
  }
  for (int i = 1, x, y, z; i < n; i++) {
    scanf("%d%d%d", &x, &y, &z);
    add_edges(x, y, z);
  }
  init();
  solve();
  cout << ans1 << " " << ans2 << endl;
  return 0;
}
