#include <iostream>
#include <vector>
#include <stdlib.h>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;

int main()
{
    long long n, m;
    cin >> n >> m;
    if (n == 2) {
        vector<int> gore;
        vector<int> dole;
        long long minic = 0;
        for (int i = 0; i < m; i++) {
            cin >> n;
            minic += n;
            gore.push_back(n);
        }
        for (int i = 0; i < m; i++) {
            cin >> n;
            dole.push_back(n);
        }
        minic -= gore.front();
        n = minic;
        for (int i = 1; i < m; i++) {
            n -= gore[i];
            n += accumulate(dole.begin(), dole.begin()+i, 0);
            minic = min(n, minic);
        }
        cout << minic;
    }
    return 0;
}