#include <bits/stdc++.h>
using namespace std;
int n, m, k;
int ans[300005][20];
vector<int> data[300005];
int cur[20];
bool is_ok(int a, int b) {
  for (int i = 0; i < 20; i++)
    if (ans[a][i] && ans[b][i] == b && ans[a][i] <= b) return true;
  return false;
}
void solve() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> k;
    for (int j = 0; j < 20; j++) {
      if ((k >> j) & 1) {
        ans[i][j] = i;
        data[cur[j]].push_back(i);
        cur[j] = i;
      }
    }
  }
  for (int i = n; i >= 1; i--) {
    for (auto& j : data[i])
      for (int k = 0; k < 20; k++) {
        if (ans[i][k] && ans[j][k])
          ans[i][k] = min(ans[i][k], ans[j][k]);
        else
          ans[i][k] += ans[j][k];
      }
  }
  while (m--) {
    int a, b;
    cin >> a >> b;
    if (is_ok(a, b)) {
      cout << "Shi" << endl;
    } else {
      cout << "Fou" << endl;
    }
  }
}
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  solve();
}
