#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> orderedset;
#define MO2 ios_base::sync_with_stdio(false);cin.tie(NULL);
#define endl '\n'
#define int long long
#define elif else if
#define sz(x) long(x.size())
#define all(vec) vec.begin(), vec.end()
const int mod = 1e9 + 7;
const int dx[] = {0, -1, 0, 1, 1, -1, 1, -1};
const int dy[] = {-1, 0, 1, 0, 1, 1, -1, -1};

int n, m;
void dope() {}

void solve() {
    cin >> n >> m;
    vector<pair<int,int>> vec(n);
    vector<int> partial_sum(2e6),Q(m);
    map<int, int> mp;
    set<int> st;
    for (auto&it:vec) {
        cin >> it.first >> it.second;
        it.first += 1e9;
        it.second += 1e9;
        st.insert(it.first);
        st.insert(it.second);
    }

    for (auto&it:Q) {
        cin >> it;
        it += 1e9;
        st.insert(it);
    }

    int counter = 1;
    for (auto&it:st) mp[it] = counter++;

    for (auto&it:vec) {
        partial_sum[mp[it.first]]++;
        partial_sum[mp[it.second] + 1]--;
    }

    for (int i = 1; i < sz(partial_sum); i++)
        partial_sum[i] += partial_sum[i - 1];

    for (auto&it:Q)
        cout << partial_sum[mp[it]] << ' ';
}
signed main() {
    MO2
#if ONLINE_JUDGE || CPH
#else
    freopen("Input.txt", "r", stdin);
    freopen("Output.txt", "w", stdout);
#endif
    int nop = 1; // cin >> nop;
    while (nop--)
    {
        solve();
        if (nop)
            cout << endl;
    }
    return 0;
}